WEB-DEVELOPMENT-APPLICATIONS practice question 2 of 25
Which attribute displays help text in an input field without specifying an actual value for the input?
Full set: 131 questionsThe placeholder attribute is used on form input elements like and
A. Default: default is not a standard HTML attribute for input fields. The value attribute is used to set a default value.
B. For: The for attribute is used on a
1. Mozilla Developer Network (MDN). (2023). : The Input (Form Input) element. In MDN Web Docs. Retrieved from https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input. See the section on the placeholder attribute.
2. WHATWG. (2024). HTML Living Standard. Section 4.10.5.2.4. The placeholder attribute. Retrieved from https://html.spec.whatwg.org/multipage/input.html#the-placeholder-attribute.
3. Vanderbilt University, Web Communications. (n.d.). HTML Forms. In Web Design & Development Courseware. Retrieved from https://www.vanderbilt.edu/web-communications/web-training/web-design-and-development.php. (General university courseware discussing form attributes).
Question breakdown
Key idea: The placeholder attribute shows hint text inside an empty input without setting the input's value.
How to reach the answer
- The clue is that the help text appears in the field but is not an actual value.
- The value attribute would set real data, so that is not what is wanted.
- The for attribute belongs to label, and name identifies the field when the form is submitted.
- placeholder displays the hint and is never submitted with the form.
Each option
Common trap: Thinking that some 'default' attribute supplies initial text, which confuses visible hint text with a real value.
In practice: Placeholders show the expected format, such as 'name@example.com'. They should support a proper label, not replace it, for accessibility reasons.
Remember: placeholder is a visual hint; value is the actual data.
Drafted with AI assistance and checked against the answer key.
Keep practicing
Take the free WEB-DEVELOPMENT-APPLICATIONS practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other WEB-DEVELOPMENT-APPLICATIONS practice questions
- Question 1Given the following JavaScript code: ```javascript var n1 = 10; var n2 = "20.39"; ``` Whi…
- Question 4Which element attaches an external CSS document to a web page?
- Question 5Which HTML tag should a developer use to create a drop-down list?
- Question 6Which method allows the end user to enter text as an answer to a question as the page loa…
- Question 8Which layout design is easiest to manage on a variety of devices?
- Question 9Which structure tag should a developer use to place contact information on a web page?
