Reputation: 1654
I have two text boxes and a button. I change the focus from one control to another whenever a keypress event is generated.
I want as soon the button get's focus it should call the click event i.e., *onclick="btnIssue_Click1".*
How this should be done in jQuery?
Upvotes: 0
Views: 534
Reputation: 337713
$("#myButton").focus(function() {
$(this).click();
});
It's worth noting that this is rather unusual behaviour, and is likely to confuse users.
Upvotes: 2