141k views
10 votes
Suppose a webpage contains a single text field. We want to make the page such that a user can immediately start typing in the text field without clicking on it. What is correct way using?

1. .
2. .
3. .
4. Can't be done with only HTML5, need help of Javascript or something else.

User Jurassix
by
4.5k points

1 Answer

7 votes

Answer:

The answer is "Option 2".

Step-by-step explanation:

In HTML5, text inputs use an autofocus attribute, which, when the page is loaded, uses a template to concentrate primarily on text fields. This attribute is a Boolean property that represents the HTML autofocus attribute, showing if the related <select> element will receive an output focus whenever the page loads if it is overruled by the user. An only form-associated entity can have this property specified in a text.

User Bwoebi
by
4.3k points