1D0-720 · Question #23
Which attribute is used to specify that a field must be filled out before submitting the form in HTML5?
The correct answer is A. required. required is a built-in HTML5 boolean attribute that prevents form submission if the field is empty, triggering the browser's native validation - simply add required (or required="") to any <input>, <select>, or <textarea> element. The other options (mandatory, validate, must)…
Question
Which attribute is used to specify that a field must be filled out before submitting the form in HTML5?
Options
- Arequired
- Bmandatory
- Cvalidate
- Dmust
How the community answered
(31 responses)- A87% (27)
- B3% (1)
- C6% (2)
- D3% (1)
Explanation
required is a built-in HTML5 boolean attribute that prevents form submission if the field is empty, triggering the browser's native validation - simply add required (or required="") to any <input>, <select>, or <textarea> element. The other options (mandatory, validate, must) are not valid HTML attributes and will be silently ignored by the browser, producing no validation behavior whatsoever. A handy memory tip: think of the form "requiring" something from the user before it will proceed - the attribute name mirrors plain English, making it one of the most self-documenting attributes in HTML5.
Topics
Community Discussion
No community discussion yet for this question.