HTML <fieldset> tag

Updated: 10/11/2017 by Computer Hope

HTML fieldset tagWhen writing in HTML, 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, as well as 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 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

Within an HTML tag, an attribute dictates certain aspects of an HTML element. Attributes are made up of a name and value pair; all tags support standard attributes. The following table shows all of the current unique HTML attributes for the <fieldset> tag, as well as a description of each.

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

Compatibility

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

Additional form elements

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