Definition and usage
The FIELDSET element groups related elements within a form, drawing a caption, like a panel in a WinForm development.
<fieldset> tags Package a portion of the form's content to generate a field for a set of related forms. The <fieldset> tag does not have a required or unique attribute.
When a set of form elements is placed inside the <fieldset> tag, the browser displays them in a special way, they may have special boundaries, 3D effects, or even create a sub-form to process the elements.
Differences between HTML 4.01 and HTML 5
There are some new properties in HTML 5, and some of the properties in HTML 4.01 are no longer supported.
Properties
Properties |
value |
Description |
HTML4 |
HTML5 |
Disabled |
true | False |
Defines whether the fieldset is visible. |
X |
√ |
Form |
true | False |
Defines one or more forms that the fieldset belongs to. |
X |
√ |
Standard properties
Class, Contenteditable, ContextMenu, dir, draggable, id, Irrelevant,lang, ref, Registrationmark, TabIndex, template, Title
Event Properties
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
This example shows how to draw a box with a caption around the data.
"text" /></label><label> Weight: <input type="text " /></label></form></fieldset><p> if there is no border around the form, your browser is too old. </p></body>
Demo effect
Tests are valid in Ie8,firefox,opera,safari,chrome
Reference: http://www.devdo.net/html5-fieldset.html
HTML5 's FieldSet label