Which element defines a caption for a fieldset?

Prepare for the Web Design EOPA Test. Study with interactive quizzes and multiple-choice questions, complete with hints and detailed explanations. Get ready for your web design certification!

Multiple Choice

Which element defines a caption for a fieldset?

Explanation:
The caption for a group of related form controls in a fieldset is provided by the legend element. Placing a legend inside a fieldset gives a label for the entire group, and screen readers will announce that label before the controls, helping users understand what the set of fields is about. The legend is usually the first child of the fieldset, and appears as a caption above the grouped inputs. This is distinct from the caption element, which is used for tables; the title element, which sets the page title; and the summary element, which is used with details for disclosure sections, not with fieldsets. For example, you’d write a fieldset with a legend like: <fieldset><legend>Contact information</legend> ... </fieldset>.

The caption for a group of related form controls in a fieldset is provided by the legend element. Placing a legend inside a fieldset gives a label for the entire group, and screen readers will announce that label before the controls, helping users understand what the set of fields is about. The legend is usually the first child of the fieldset, and appears as a caption above the grouped inputs. This is distinct from the caption element, which is used for tables; the title element, which sets the page title; and the summary element, which is used with details for disclosure sections, not with fieldsets. For example, you’d write a fieldset with a legend like:

Contact information ...
.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy