104
HTML <fieldset> tag
HTML <fieldset> tag is used to group the logically related fields/labels contained within an HTML form.
The use of this tag is optional while creating an HTML form but using <filedset>, it is easy to understand the purpose of grouped elements of form.
The <legend> tag is used with the <fieldset> element as a first child to define the caption for the grouped related fields.
Syntax
Following are some specifications about the HTML <fieldset> tag
Display | Block |
Start tag/End tag | Both Start and End tag |
Usage | Structural (Within HTML Form) |
Example 1
Output:
Attribute
= New in HTML5.
Tag-specific attribute
Attribute | Value | Description |
---|---|---|
disabled | disabled | It specifies that all form controls within the fieldset element are disabled. |
form | form_id | It specifies the one or more form(s) to which fieldset controls belongs. |
name | text | It specifies the name associated with fieldset. It will not display at the browser and useful with JS. |
Global attribute
HTML < fieldset > tag supports the global attributes in HTML
Event attribute
HTML < fieldset > tag supports the event attributes in HTML.
Supporting Browsers
Element | Chrome | IE | Firefox | Opera | Safari |
<fieldset> | Yes | Yes | Yes | Yes | Yes |
Next TopicHTML figcaption Tag