»
S
I
D
E
B
A
R
«
JavaScript: Bug using .focus() for legacy coding and FF
March 4th, 2010 by admin

Hopefully you have found this article before you bashed your head open with your keyboard; if not, please seek medical help before continuing.

When using the .focus() method today, I came across an issue with Firefox — though, I would assume it is for all legitimate browsers. If you are having trouble getting .focus() working, kindly apply the following code.

setTimeout( function(){document.getElementById('field').focus();}, 10 );

Unfortunately, I have no reason why it works, I merely know that it does work.

Nick


Leave a Reply

You must be logged in to post a comment.

»  Substance: WordPress   »  Style: Ahren Ahimsa