May 03, 2021 HTML5
HTML5 and fieldset tags are used to group related elements in a form:
<form>
<fieldset>
<legend>Personalia:</legend>
Name: <input type="text"><br>
Email: <input type="text"><br>
Date of birth: <input type="text">
</fieldset>
</form>
All major browsers support the hashtags.
Labels group related elements within a form.
The label draws a border around the relevant form element.
Tip: The label defines the title for the element.
Some new properties have been added to HTML5: disabled, form, name, which are not supported in HTML 4.01.
New: The new property in HTML5.
Property | Value | Describe |
---|---|---|
disabled New | disabled | Provides that the related form elements in the group should be disabled. |
form New | form_id | Specifies one or more forms to which fieldset belongs. |
name New | text | Specifies the name of the fieldset. |
The label supports the global properties of HTML.
The tag supports the event properties of HTML.