HTML Forms: Inputs
Data collection is the heart of interactivity. Checkboxes and Radio Buttons are the primary tools for discrete user choices.
Checkboxes
Created with <input type="checkbox">. These operate independently. A user can select zero, one, or many checkboxes in a group.
Radio Buttons
Created with <input type="radio">. The key here is the name attribute. If multiple radios share the same name, they become a group where only one can be selected at a time.
Grouping Elements
To semantically group controls, wrap them in a <fieldset> and use a <legend> to define the group title. This is vital for screen readers.
View Full Transcript+
This section contains the full detailed transcript of the video lessons regarding form inputs, specifically the distinction between boolean selection (checkboxes) and exclusive selection (radios), and how to properly associate labels for accessibility.
