The problem is that when there is a focus on one #input1
, and i try to focus it on #input2
by running
$('#input2').focus();
first runs the focusin
event of #input2
then the focusout
of the #input1
Why does this happen, why isn't focusout
running first?
Please see for an example http://jsfiddle.net/zZZsD/3/ Type in first input 4 symbols
UPDATE: Btw, I've used delegated binding instead of direct for performance reasons,there will be potentially lots of input fields...