English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
This article introduces the usage of the HTML fieldset form attribute, with online examples demonstrating how to use the HTML fieldset form attribute, browser compatibility, syntax definition, and detailed information about its attribute values.
The <fieldset> element located outside the form (but still part of the form):
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML <fieldset> form Attribute Usage-基础教程(oldtoolbag.com)</title> </head> <body> <form action="action_page.php" method="get" id="form1"> What is your favorite color? <input type="text" name="fav_color"><br> <input type="submit"> </form> <p>The fieldset below is outside the form, but it is still part of the form./p> <fieldset form="form1"> <legend>Personalia:</legend> Name: <input type="text" name="username"><br> Email: <input type="text" name="usermail"><br> </fieldset> </body> </html>Test it out ‹/›
IEFirefoxOperaChromeSafari
Currently, only Opera supports the form attribute.
The form attribute specifies one or more forms that the fieldset belongs to.
The form attribute in HTML5 new attribute in the syntax.
<fieldset form="form_id">
Value | Description |
---|---|
form_id | Specify a space-separated list of one or more form ids that the fieldset belongs to. |