HTML fieldset tag

HTML <fieldset> encloses the the form elements (Form structure) in a block under a common name.

The common name is specified using legend element.

Example

Form Name:
Email:
Try </>

Specific uses

It encloses the form in a block under a common title.

Nested fieldset elements may also be used.

Related tags

TagsDescription
<form> form element defines a form that collects the data of a person.
<form><input type="text" name="fname"></form>
<input> It represent an editable input field.
<input type="text" name="fname">
<legend> It defines a caption or title for the form.
<legend>It contains the title of the form. </legend>

Tag omission

Both starting and ending tags are necessary for the fieldset element.

Global Attributes

All the global attributes are applicable on the fieldset element.

Related Attributes

<fieldset> tag attributes

AttributesDescription
disabled This attribute disables all the elements in the fieldset. None of the input is editable.
<fieldset disabled><legend> <form> form structure </form> </legend></fieldset>
form This attribute links fieldset element to a specific form.
<fieldset form="The name of form to associate with fieldset"> <legend></legend> </fieldset>
name This attribute gives a special or unique name to the fieldset element.
<fieldset name="a unique name"><legend> <form> form structure </form> </legend></fieldset>


Was this article helpful?

 

Email:

Message:

Get the newsletter