Found 8862 Articles for Front End Technology

HTML autofocus Attribute

Chandu yadav
Updated on 29-Jun-2020 08:44:41

69 Views

The autofocus attribute of the element is used to specify which of the would get focus when the web page loads. This attribute introduced in HTML5.Following is the syntax −Let us now see an example to implement the autofocus attribute of the element −Example Live Demo Log in to your account    Id:    Password:    DOB:    Submit OutputIn the above example, we have created a form −    Id:    Password:    DOB:    Submit We have set autofocus to the third input as shown below i.e. DOB, therefore the cursor is visible there itself −DOB:

HTML