What event is responsible for the decrease value in input[type=number]?

Write in jQuery, so preferable option for him. Change the values bound to the change event, but it only works increase. Tell me how to do subtraction, if the value decreases? Thank you!
July 4th 19 at 23:58
1 answer
July 5th 19 at 00:00
Solution
onchange even in Africa onchange: raise or twist there is not important: it works!
PS: show code.
UPD: stackoverflow.com/questions/29118178/input-jquery-...
$(width1).css("width", currentPos1 + 15);

It is clear that here adds. The point is that I do not understand how to link the decrease to the reduction :) - janelle_Murphy78 commented on July 5th 19 at 00:03
: are you serious? if the new value is less than the previous one - hence the reduction. - marcelino_Emmeri commented on July 5th 19 at 00:06
: or "plus" is replaced by "minus" or code in Studio) - Kyleigh_Hills commented on July 5th 19 at 00:09
: how to make this comparison? $("#num").on("change", function() {})

Each time you change the value of #num.val() changes, i.e. I can't compare. - janelle_Murphy78 commented on July 5th 19 at 00:12
: just wanted to unsubscribe that resolved the issue. I described a new function (wrapper over jquery), in everything else just as well :) thank you - janelle_Murphy78 commented on July 5th 19 at 00:15
:
can.
var old = 0;

$("#num").on("change", function() {
var $this = $(this);

if($this.val() < old) { // your code to reduce } // here could. Yes?

old = $this.val();
}) - marcelino_Emmeri commented on July 5th 19 at 00:18

Find more questions by tags jQueryJavaScript