The fieldset element allows us to group different form elements (controls) into thematically similar groups. That usually helps users understand better the larger forms as well as it makes a form more accessible via improved tabbing navigation.
The legend element is actually a caption of a fieldset.
By applying a proper styling (via a style sheet) to fieldsets and legends, we ensure that a user ends up with a much better experience upon finishing using the form.
Syntax:
<fieldset><legend></legend><input type="" name="" /><input type="" name="" /></fieldset>
Attributes:
- id, class (document-wide identifiers)
- lang (language information), dir (text direction)
- title (element title)
- style (inline style information)
- accesskey (access keys)
- onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup (intrinsic events)
Example
HTML fieldset and legend elements:
Comments
No comments have been made yet.
Please login to leave a comment. Login now