Which HTML attribute automatically focuses a form control when the page loads?

Prepare for the uCertify CIW Advanced HTML5 and CSS3 Specialist Exam. Dive into essential topics with flashcards and multiple-choice questions. Enhance your understanding with hints and explanations for each question. Pass your exam confidently!

Multiple Choice

Which HTML attribute automatically focuses a form control when the page loads?

Explanation:
Autofocus makes a form control receive focus automatically when the page loads. By placing the autofocus attribute on an input, textarea, select, or button, that element is ready for typing or interaction immediately, so the user can start without clicking. The attribute is a boolean—its presence activates it. If more than one element has autofocus, browsers typically focus the first one, though behavior can vary. The other options don’t fit: Required enforces that the field must be filled before submitting, Placeholder shows sample text inside the field, and Disabled prevents interaction and removes focusability.

Autofocus makes a form control receive focus automatically when the page loads. By placing the autofocus attribute on an input, textarea, select, or button, that element is ready for typing or interaction immediately, so the user can start without clicking. The attribute is a boolean—its presence activates it. If more than one element has autofocus, browsers typically focus the first one, though behavior can vary. The other options don’t fit: Required enforces that the field must be filled before submitting, Placeholder shows sample text inside the field, and Disabled prevents interaction and removes focusability.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy