Which attribute prevents a form from being submitted while a field is empty?
-
A
notnull
-
B
mandatory
-
C
validate
-
D
required
Correct answer
Correct answer
D. required
14 views
Explanation
The boolean required attribute triggers the browser's built-in validation message. It works with inputs, selects and textareas.
Reference
Asked in: NTS, Web Developer Interviews
Doubts & discussion
Not sure why the answer is D? Ask here and get an explanation.
Ask a doubt about this MCQ