Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*http://stackoverflow.com/a/16139296/835950*/
- jQuery(".increment").on('click',function(){
- jQuery(this).next(".amount input").val(parseInt(jQuery(this).next(".amount input").val())+1);
- });
- jQuery(".decrement").on('click',function(){
- var value = (parseInt(jQuery(this).prev(".amount input").val())-1);
- jQuery(this).prev(".amount input").val((value-1) < 0 ? 0 :(value -1))
- });
Advertisement
Add Comment
Please, Sign In to add comment