Which HTML5 attribute provides a hint identifying the expected input in a form field?

Prepare for the CIW Advanced HTML5 and CSS3 Specialist Exam. Study effectively with comprehensive materials, flashcards, and engaging multiple-choice questions. Enhance your expertise and get ready to succeed!

Multiple Choice

Which HTML5 attribute provides a hint identifying the expected input in a form field?

Explanation:
Providing a hint about the expected input is done with the placeholder attribute. When the input field is empty, the placeholder text appears inside it (for example, name@example.com in an email field) to show the user what kind of data to enter. This hint disappears as soon as the user starts typing and it isn’t included in the submitted data, making it a lightweight guide rather than part of the actual value. The other attributes serve different purposes: autocomplete suggests previously entered values, not a current-field hint; pattern enforces a required format using a regular expression; and the title provides a tooltip-style message rather than in-field guidance. For accessibility, pair a placeholder with a proper label so users relying on screen readers still understand the field’s purpose.

Providing a hint about the expected input is done with the placeholder attribute. When the input field is empty, the placeholder text appears inside it (for example, name@example.com in an email field) to show the user what kind of data to enter. This hint disappears as soon as the user starts typing and it isn’t included in the submitted data, making it a lightweight guide rather than part of the actual value. The other attributes serve different purposes: autocomplete suggests previously entered values, not a current-field hint; pattern enforces a required format using a regular expression; and the title provides a tooltip-style message rather than in-field guidance. For accessibility, pair a placeholder with a proper label so users relying on screen readers still understand the field’s purpose.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy