html - jQuery - equivalent of change/keyup -


i have dropdown menus , input text fields. don't want use change because input text field need lose focus work. , keyup pointless on dropdown menu.

is there change , keyup can use effective both inputs , dropdowns?

you can add 2 different js events (one inputs , other dropdowns) calling common method or different method per requirement. events can this:

<script type="text/javascript"> $(document).ready(function(){ $("select").on("change", function(){ // or select on basis of class dosomething(); });  $("input[type=text]").on("keyup", function(){ // or select on basis of class dosomething(); }); });  function dosomething() { // action here } </script> 

you can modify code per need, let me know if need further clarification.


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -