2
I am unable to change the input value id="value" when you click on .Minus or .plus, what I must do to resolve?
<input type="button" value="+" class="plus">
<input id="value" step="1" max="99" min="1" title="Qty" class="qty" type="number" name="prod[<?php echo $result['id']?>]" value="<?php echo $result['quantity']?>" size="4" />
<input type="button" value="-" class="minus">
jquery
$('.plus').click(function() { changeValue(1); });
$('.minus').click(function() { changeValue(-1); });
function changeValue(val) {
var container = $('#value');
var current = parseInt(container.html(), 10);
container.html(Math.max(0, current + val).toString());
}