Remember how the and ++ operator works if you put it after updating after the fact, so you change the value xafter changing the input value, so just put them before
var x = 1;
$("#sinolo input").attr('value', x);
$("#inc").click(function(){
$("#sinolo input").attr('value', ++x);
});
$("#dec").click(function(){
$("#sinolo input").attr('value', --x);
});
nottu source
share