Javascript focus on input element
Ever wanted to know how when you go to a site the cursor is automatically “stuck” on a particular form element? Its pretty simple actually, just add the following to your input tag:
onload="document.formname.inputname.focus()"
Pretty much how it reads, formname is the name of your form, input name is the name of the field on your form.
If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!
Leave a Reply
You must be logged in to post a comment.





