Reputation: 73
I have an input text field and a button.
How can I get focus on button with id-'searchref'on focus of my input text field using JQuery?
Upvotes: 0
Views: 75
Reputation: 4597
you can use focus() method to bind an event handler to the "focus" JavaScript event, or trigger that event on an element.
$('selector').focus(function(){ // your code goes here })
Upvotes: 2