autofocus attribute



Autofocus attribute is used to place the cursor in text box on its own, when a page gets loaded.

Example Code:

Result :

Name: Contact Num:
  • It is a boolean attribute. So, the value can be either "autofocus" or an empty value.
  • It is included with the <input>.


It is applicable in all major web browsers, except Internet Explorer.

Ask Questions

Ask Question