$.focus() not working

The last example of jQuery’s focus() documentation states

$('#id').focus()

should make the input focused (active). I can’t seem to get this working.

Even in the console on this site, I’m trying it for the search box

$('input[name="q"]').focus()

and I’m getting nothing. Any ideas?

19 Answers
19

Leave a Comment