Tag Description
The fieldset tag is used to logically group together elements in a form. It visually does this by drawing a box around the related form elements.
This tag has the form:
<fieldset>
</fieldset>
Note: The <legend>
tag defines a caption for the fieldset element.
HTML5 and HTML4.01 Differences
None.
HTML5 | = New for HTML5 |
Attributes
Attribute | Value | Description |
---|---|---|
disabledHTML5 | disabled | Specifies if the fieldset is visible or not |
formHTML5 | form_id | Defines one ore more forms the fieldset belongs to |
nameHTML5 | text | Specifies the name of the fieldset |
Global Attributes
This tag also supports the HTML Global Attributes.
Event Attributes
This tag also supports the HTML Event Attributes.
Examples
The following example shows the basic use of this tag:
<form>
<fieldset>
<legend>Employee Info</legend>
Name:
<input type="text" size="30" />
Email:
<input type="text" size="30" />
Birth Date:
<input type="text" size="10" />
</fieldset>
</form>
This produces the following result:
Browser Support
Chrome | Firefox | IE | Safari | Opera |
---|---|---|---|---|
Doctype Declaration Support
The following table lists the doctype declarations this element may appear in:
HTML4.01 / XHTML1.0 | XHTML 1.1 | HTML 5 | ||
---|---|---|---|---|
Traditional | Strict | Frameset | ||
Miscellaneous Information
Defined In: | HTML4 |
---|---|
Empty Tag: | No |