Book
Submodule 8.1: The HTML of forms
Submodule 8.1: The HTML of forms
Completion requirements
View
- role and creation of a form
- elements
- attributes
- accessibility
Grouping Form Data
The <fieldset>
element is used to group related data in a form. When is used, it draws a box around these elements.
The <legend>
element is used to define a caption for the <fieldset>
element.
<fieldset>
<legend>
Please, fill in the following information:
</legend>
<label for="firstname">First name:</label>
<input type="text" name="firstname" id="firstname"
placeholder="Your name goes here"
size="20" autofocus="autofocus" required/> <br><br>
<label for="secretword">Your password:</label>
<input type="password" name="secretword" id="secretword"
placeholder="Your password goes here"
size="20" required/><br><br>
</fieldset>