Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery event when a type number field is modified by the arrows aside of the field

I have this input type="number" field on my application:

<input type="number" id="quantidade" class="form-control">

So I have this jQuery code to execute some stuff at the event keyup:

$("#quantidade").keyup(function(event){
    //code that's working like a charm
});

That's working well when the user enter some value on the field. But, in browsers like Chrome and Firefox, type number fields have two little arrows aside the field to increase or decrease the value:

enter image description here

Clicking on these arrows does not active the keyup event. So, how can I activate the same code when the user click on the arrows? Which kind of event I can use for that?

like image 616
Keoma Borges Avatar asked Jan 24 '16 23:01

Keoma Borges


1 Answers

Try that one :

$("#quantidade").on("keyup keydown change",function(event){
    //code that's working like a charm
});
like image 180
Yehia Awad Avatar answered Sep 22 '22 20:09

Yehia Awad