Reputation: 19
i need to change values of a "Focused" dropdown on keypress using jquery.
i need,
thanks in advance.
Upvotes: 1
Views: 1734
Reputation: 166
To see if object is selected:
if($(".foo").is(':focus')){
// do something
}
To change values on keypress:
$(".foo").bind("keypress", function(e){
$(this).attr('value', 'bar');
})
Though not sure what you mean by changing the values of a drop down, or why you'd want to do that.
Upvotes: 1