Last Updated: February 25, 2016
·
386
· voiddragon

Focus Element with jQuery

I thought

$('#target').focus();

would work fine

Turns out it doesn't work, seems chrome fires the event too quickly.

setTimeout(function(){$('#target').focus();},0);

Works great!