$(document).ready(function () {
$(".quantity-adder .add-action").click(function () {
if ($(this).hasClass('add-up')) {
var text = $(this).parent().parent().parent().find("[name=quantity]", '.quantity-adder')
text.val(parseInt(text.val()) + 1);
} else {
var text = $(this).parent().parent().parent().find("[name=quantity]", '.quantity-adder')
if (parseInt(text.val()) > 1) {
text.val(parseInt(text.val()) - 1);
}
}
});
});
I added the .parent()
so that then find the proper text to increase
7
solved How to individually increase or decrease a value using jquery