I am making the Review Cart & Checkout form. IF user want to change the quantity I want that if quantity is changed the price of it will be changed automatically.
Please help to adjust the code in the same JS of plus minus or separate.
Image is below of Review Cart & Checkout:
JS for Plus & Minus:
<script type="text/javascript">
function subtractQty(){
if(document.getElementById("number").value - 1 < 0)
return;
else
document.getElementById("number").value--;
}
</script>
HTML/PHP for plus minus:
<div class="quantity">
<input style="font-size:21px;" type="button" value="-" onclick='javascript: subtractQty();' class="">
<input id="number" type="number" value="<?php echo $qtyT; ?>" class="qty" name="picpac">
<input style="font-size:21px;" type="button" value="+" onclick='javascript: document.getElementById("number").value++;' class="plus">
</div>