<fieldset>
HTML <fieldset> Tag
Instance
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文网(php.cn)</title> </head> <body> <form> <fieldset> <legend>Personalia:</legend> Name: <input type="text"><br> Email: <input type="text"><br> Date of birth: <input type="text"> </fieldset> </form> </body> </html>
Run Example»
Click the "Run Instance" button to view the online instance
Browser support
All major browsers support< fieldset> tag.
Tag definition and usage instructions
<fieldset> Tags can group related elements within a form. The
<fieldset> tag draws a border around the related form element.
Tips and Notes
Tip: The <legend> tag defines the title for the <fieldset> element.
Differences between HTML 4.01 and HTML5
HTML5 adds some new attributes of <fieldset>: disabled, form, name, these attributes are not supported in HTML 4.01 .
Attribute
New: New attribute in HTML5.
Properties | Value | Description |
---|---|---|
disabledNew | disabled | Specifies that related form elements in this group should be disabled. |
formNew | form_id | Specifies one or more forms to which the fieldset belongs. |
nameNew | text | Specifies the name of the fieldset. |
Global attributes
The<fieldset> tag supports global attributes of HTML.
Event attributes
<fieldset> tag supports HTML event attributes.