Group related elements in a form:
The <fieldset> tag is used to group related elements in a form.
The <fieldset> tag draws a box around the related elements.
Element | |||||
---|---|---|---|---|---|
<fieldset> | Yes | Yes | Yes | Yes | Yes |
Tip: The <legend> tag defines a caption for the <fieldset> element.
HTML5 has added new attributes for <fieldset>.
= New in HTML5.
Attribute | Value | Description |
---|---|---|
disabled | disabled | Specifies that a group of related form elements should be disabled |
form | form_id | Specifies one or more forms the fieldset belongs to |
name | text | Specifies a name for the fieldset |
The <fieldset> tag also supports the Global Attributes in HTML.
The <fieldset> tag also supports the Event Attributes in HTML.
HTML DOM reference: Fieldset Object
Most browsers will display the <fieldset> element with the following default values: