How can I set the focus to a certain element in a form using JavaScript?

Posted by Rayne on Stack Overflow See other posts from Stack Overflow or by Rayne
Published on 2010-05-09T21:25:36Z Indexed on 2010/05/09 21:28 UTC
Read the original article Hit count: 120

Filed under:

My page has a form that has a text field in it. I'd like to set the focus to that text field as soon as the page loads, so that users do not have to click it to start typing. How can I do this?

© Stack Overflow or respective owner

Related posts about JavaScript