<fieldset> tags Package a portion of the form's content to generate a field for a set of related forms.
When a set of form elements is placed inside the <fieldset> tag, the browser displays them in a special way, they may have special boundaries, 3D effects, or even create a sub-form to process the elements.
The <fieldset> tag does not have a required or unique attribute.
The <legend> tag defines the caption for the fieldset element.
Differences between HTML 4.01 and HTML 5
HTML5 has the following properties: These properties are not supported in disabled, form, name,html 4.01.
Property
Properties |
value |
Description |
Disabled |
Disabled |
Specifies that fieldset should be disabled. |
Form |
form_id |
Specifies one or more forms to which fieldset belongs. |
Name |
Value |
Specifies the name of the fieldset. |
Instance:
<! DOCTYPE html> Height:<input type="text" /> Weight:<input type=" text " /> </fieldset></form><p> If there is no border around the form, your browser is too old. </p></body>
The effect is as follows:
HTML <fieldset> Tags group related elements within a form