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!
Written by Gerald Goh
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Javascript
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#