← back to WGD home

Form Elements

Novalidate/Method/Action

Fieldset and Legend

The fieldset is used to group several controls and labels within a form. It can be styled using CSS. The legend element is used as a child of the fieldset and is styled as the title or caption of the fieldset group.

Label (for and ID)

The label element provides a label for an element of an HTML form. The for attribute should match the id of the labelable element to meet accessibility standards and to help website visitors. The first element in the document with the same value for an ID as the value of the for attribute will be grouped with the label.

Summary

There are plenty of form elements and attributes available in HTML, and it is important to have a general understanding of most of them to give website users a positive experience.