HTML and CSS Reference
In-Depth Information
<label for=“email">Email
*
:</label>
<input type="email" name="email" id="email" required>
10.
Create a new
<p>
element at the top of the form.
11.
Add a
class
attribute to this
<p>
element and set its value to
validation-tip
. This will be used for
styling purposes.
12.
Now add the following text to this
<p>
element.
<p class="validation-tip">
* Indicates a required field.
</p>
13.
Save the
bookings.html
file.
You have now applied validations to all of the form fields!
If you view the updated bookings form in your web browser, you should see that only the text labels and validation
tip have changed, as shown in Figure 7-1.
Figure 7-1
The bookings form with validations, shown in Opera.