<script>
$(document).ready(function(){
$(".qty-increase, .qty-decrease").click(function(event){
id = this.id;
quantity = $("#input-quantity1_"+id).val();
alert(quantity);
});
});
</script>
<div class="input-content">
<div class="box-qty">
<input type="text" name="quantity" value="1" id="input-quantity1_<?php echo $row_cart['id']; ?>" class="input-text qty">
<input type="hidden" name="product_id" value="44">
<div class="qty-arrows" style="margin-top: -40px;">
<input type="button" value="+" onclick="var qty_el = document.getElementById('input-quantity1');
var qty = qty_el.value;if (!isNaN(qty))qty_el.value++;return false;" id="<?php echo $row_cart['id']; ?>" class="qty-increase">
<input type="button" value="-" onclick="var qty_el = document.getElementById('input-quantity1');
var qty = qty_el.value;if (!isNaN(qty))qty_el.value--;return false;" id="<?php echo $row_cart['id']; ?>" class="qty-decrease">
</div>
</div>
</div>
在这段代码中,我有数量增加和数量减少类型的按钮。当我点击qty-increase然后价值增加。在减少的情况下也是如此。现在,当我点击时会发生什么qty-increase,它只提醒值1并且值保持不变。那么,如果我增加或减少,我如何获得价值?请帮我。