I have an input type number
<input class="item" type="number" min="1" max="500" step="1" value="1" />
Now, to check for changes to this element, I used
$(".item:input").bind('change', function (e) {
}
Now in this function, how can I check if the up arrow or down arrow of this element is pressed
I'm looking for something like the following
$(".item:input").bind('change', function (e) {
if(this up arrow pressed){
print(up);
}else{
print(down);
}
}
How to do it?
source
share