Skip to content

Instantly share code, notes, and snippets.

@johnbocook
Last active November 5, 2015 14:14
Show Gist options
  • Select an option

  • Save johnbocook/5878a76b907f630b4e2d to your computer and use it in GitHub Desktop.

Select an option

Save johnbocook/5878a76b907f630b4e2d to your computer and use it in GitHub Desktop.
You can place a user's cursor inside an input via focus as soon as the page is loaded. This helps ensure that visitors do not 'overlook' an important form item on your site.
//Change coolFormName to form's name.
<body onload="document.coolFormName.user.focus();">
<form name="coolFormName">
Name: <input type=text name=user size=10>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment