nerdexam
CIW

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)…

Advanced HTML5 Features

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)
  • A
    87% (27)
  • B
    3% (1)
  • C
    6% (2)
  • D
    3% (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

#HTML5 form validation#required attribute#form fields#input constraints

Community Discussion

No community discussion yet for this question.

Full 1D0-720 Practice