increment decrement products qty

var qtyField = $('.ba-product__qty-field'), qtyUp = $('.ba-product__qty-up'), qtyDown = $('.ba-product__qty-down'); qtyUp.on('click', function(event) { event.preventDefault(); var currentValue = qtyField.val(); qtyField.val(++currentValue); }); qtyDown.on('click', function(event) { event.preventDefault(); var currentValue = qtyField.val(); if (currentValue > 1) { qtyField.val(--currentValue); } });
increment decrement products qty

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.