HTML 5 <fieldset> tag
Definition and Usage
The fieldset element is used to logically group together elements in a form,
and draw a box around them.
Differences Between HTML 4.01 and HTML 5
HTML 5 has some new attributes, and some HTML 4.01 attributes are no longer supported.
Tips and Notes
Note: You can disable a fieldset with the new attribute: disabled.
Tip: Use the <legend> element to add a caption to the fieldset.
Example
Attributes
- 4: indicates if the attribute is defined in HTML 4.01
- 5: indicates if the attribute is defined in HTML 5
Attribute |
Value |
Description |
4 |
5 |
disabled |
true | false |
Defines if the fieldset is visible or not |
|
5 |
form |
true | false |
Defines one ore more forms the fieldset belongs to |
|
5 |
Standard Attributes
class, contenteditable, contextmenu, dir, draggable, id,
irrelevant, lang, ref, registrationmark, tabindex, template, title |
For a full description, go to Standard
Attributes in HTML 5.
Event Attributes
onabort, onbeforeunload, onblur, onchange, onclick,
oncontextmenu, ondblclick, ondrag, ondragend, ondragenter, ondragleave,
ondragover, ondragstart, ondrop, onerror, onfocus, onkeydown, onkeypress,
onkeyup, onload, onmessage, onmousedown, onmousemove,
onmouseover, onmouseout, onmouseup, onmousewheel, onresize, onscroll, onselect,
onsubmit, onunload |
For a full description, go to Event Attributes
in HTML 5.
Try-It-Yourself Demos
Fieldset around
data
How to draw a border with a caption around your data.
…
|