HTML <fieldset> formAttribute
Examples
A <fieldset> element located outside the form (but still part of the form):
<form action="demo_form.html" method="get" id="form1">
What is your favorite color? <input type="text" name="fav_color"><br>
<input type="submit">
</form>
<fieldset form="form1">
Name: <input type="text" name="username"><br>
Email: <input type="text" name="usermail"><br>
</fieldset>
What is your favorite color? <input type="text" name="fav_color"><br>
<input type="submit">
</form>
<fieldset form="form1">
Name: <input type="text" name="username"><br>
Email: <input type="text" name="usermail"><br>
</fieldset>
Try it Yourself »
Browser Support
![]()
![]()
![]()
![]()
![]()
Currently, only Opera supports the form attribute.
Definition and Usage
The form attribute specifies one or more forms to which the fieldset belongs.
Differences between HTML 4.01 and HTML5
The form attribute is new in HTML5.
Syntax
<fieldset form="form_id">
Attribute Values
| Value | Description |
|---|---|
| form_id | Specifies a space-separated list of form ids to which the fieldset belongs. |
HTML <fieldset> Tag Other Extensions