Autofocus

The autofocus attribute is used to set the “focus” of a browser to the specified form element after the page loads.

Refresh the page. See how the cursor is blinking inside the password input box? This means it is “focused,” and can take input right away.

HTML
<p>
  Password:
  <input type="password" name="password" id="test-password" autofocus />
</p>

Please Enter:

Birth Year:

Net ID:

Password:

Comments or Concerns:

NOTE: Unlike most attributes, there is no “value” to assign. Therefore the attribute it passed in alone.