I have write jquery code with use of classes, the problem is each product gets incremented even i changed for just one product. I want to do if user increment one field than the amount will calculat in his parent text-box, but actually when i increment for one product the amount increment for both product.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
<script>
$(document).ready(function() {
$(".quantity").change(function(){
$(".subTotal").val(parseInt($(this).val()) * parseInt($(".price").val()));
});
});
</script>
</head>
<body>
<tr>
<td><input type="text" class="price" value="1000" readonly></td>
<td><input type="number" min="0" class="quantity" value="1"></td>
<td><input type="text" class="subTotal" value="1000"></td>
</tr>
<tr>
<td><input type="text" class="price" value="1000" readonly></td>
<td><input type="number" min="0" class="quantity" value="1"></td>
<td><input type="text" class="subTotal" value="1000"></td>
</tr>
</body>
</html>
</div>