When i clicked the + button the quantity value is changed. But I want to change the value of Price and then total.
我的代码在这里。
<tr class="rem1" id="test">
<td class="invert">
<div class="quantity">
<div class="quantity-select">
<div class="entry value-minus"> </div>
<div class="entry value"><span>1</span></div>
<div class="entry value-plus active"> </div>
</div>
</div>
</td>
<td class="invert"><span class="pr"><?php echo $row['product_price']; ?> </span>
</td>
</tr>
<tr>
<td><?php echo $total; ?>
</td>
</tr>
<script>
$('.value-plus').on('click', function(){
var divUpd = $(this).parent().find('.value'),
newVal = parseInt(divUpd.text(), 10)+1;
divUpd.text(newVal);
var Row = document.getElementById("test");
var Cells = Row.getElementsByTagName("td");
var valGet = Cells[0].innerText;
var prGet = Cells[1].innerText;
// here is logic to change the values of price and total
// If multiple row its only get last row value.
});
</script>