The HTML <fieldset> label groups related elements in the form, and the fieldset form.
<Fieldset> the label packs a part of the Form Content and generates a set of related form fields.
When a group of form elements are placed in the <fieldset> label, the browser displays them in a special way. They may have special boundaries and 3D effects, or you can even create a subform to process these elements.
<Fieldset> the tag does not have a required or unique attribute.
<Legend> the label defines the title for the fieldset element.
Differences between HTML 4.01 and HTML 5
HTML5 has the following attributes: disabled, form, name, and HTML 4.01 do not support these attributes.
Attribute
| Attribute |
Value |
Description |
| Disabled |
Disabled |
Fieldset should be disabled. |
| Form |
Form_id |
Specifies one or more forms to which fieldset belongs. |
| Name |
Value |
Specifies the name of fieldset. |
Instance:
<! Doctype html>
The effect is as follows: