...
$(document).ready(function(){
$('form').submit(function(){
$('input#second').focus();
return false;
});
$('#first').blur(function(){
alert('blur');
});
});
...
<form>
<input id=first><br>
<input id=second><br>
<input type=submit>
</form>
...
- Load the page
- Click on first input to give it focus
- Hit Enter to submit the form
Then the following happens:
- $('form').submit() is called and
- It sets focus to the #second input and exits
- #first looses focus, #second gets it, but...
- $('#first').blur() is not called
Here is a live demo.
What am I missing?
Thanks