1D0-720 · Question #7
Which HTML5 global attribute is useful for associating a form control with a form?
The correct answer is C. form. The form attribute (C) is an HTML5 global attribute that accepts a form's id value, allowing a form control to be associated with a <form> element even when the control exists outside that form in the DOM - a powerful layout flexibility feature. Why the distractors are wrong…
Question
Which HTML5 global attribute is useful for associating a form control with a form?
Options
- Acontenteditable
- Bstyle
- Cform
- Dspellcheck
How the community answered
(21 responses)- A10% (2)
- B5% (1)
- C86% (18)
Explanation
The form attribute (C) is an HTML5 global attribute that accepts a form's id value, allowing a form control to be associated with a <form> element even when the control exists outside that form in the DOM - a powerful layout flexibility feature.
Why the distractors are wrong:
- A.
contenteditable- makes an element's content editable by the user; has nothing to do with form association - B.
style- applies inline CSS styling; purely presentational - D.
spellcheck- hints to the browser whether to spell-check the element's content; unrelated to form association
Memory tip: Think of it literally - the attribute is named form because it links a control to a form. If you see <input form="myForm">, that input submits with the <form id="myForm"> regardless of where it sits in the HTML.
Topics
Community Discussion
No community discussion yet for this question.