how to change values of a dropdown on key press using jquery -


i need change values of "focused" dropdown on keypress using jquery.

i need,

  1. how foucsed drop down or how can check whether drop down has focus.
  2. how change drop down values in key press 1,2,3 etc. using jquery.

thanks in advance.

to see if object selected:

if($(".foo").is(':focus')){     //  } 

to change values on keypress:

$(".foo").bind("keypress", function(e){     $(this).attr('value', 'bar');   }) 

though not sure mean changing values of drop down, or why you'd want that.


Comments

Popular posts from this blog

Javascript line number mapping -

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -