HTML <fieldset> tag

Updated: 11/13/2018 by Computer Hope
HTML fieldset tag

When writing in HTML (hypertext markup language), the <fieldset> tag is used to group related elements in a form by drawing a box around them. The following sections contain information about this tag, including an example of it in use, and related attributes and browser compatibility.

Tip

You can add a caption to the <fieldset> element using the <legend> tag.

Note

The <fieldset> tag belongs to a group of tags called form elements.

Example of <fieldset> code

<form>
<fieldset>
<legend>Personal Information:</legend>
Name: <input type="text"><br>
Address: <input type="text"><br>
Email: <input type="text"><br>
Phone: <input type="text">
</fieldset>
</form>

Example result

Personal Information: Name:
Address:
Email:
Phone:

Attributes

All HTML tags support standard attributes that define the settings of an HTML element. In addition to the standard settings, the <fieldset> tag has the following unique attributes.

Attribute Description
disabled Designates that the content in the fieldset element should be disabled.
form Designates the form(s) of where the fieldset belongs.
name Designates a name for the fieldset.

Compatibility

Edge Internet Explorer Firefox Safari Opera Chrome
All versions All versions All versions All version All versions All versions

Additional form elements

Browser, Compatibility, Container tag, HTML form tag, URL, Web design terms