Which element is used to group related form controls together?
<fieldset>
Best input type for an email address
type="email"
Attribute that makes sure a field cannot be left blank.
required
In regex, \d represents what?
A digit (0–9)
<input type="text" required="false">
Why is this wrong?
required is boolean; you either include it or not. required="false" still means required.
Which element provides a caption for a fieldset?
<legend>
Best input type for picking a date from a calendar.
type="date"
Attribute that sets the minimum value for a number input.
min
Pattern \d{5} matches what?
Exactly 5 digits
<input type="email" required>
What kind of validation does the browser provide automatically?
Checks for a basic email format like name@domain
Which element provides an autocomplete options list to an <input>?
<datalist>
Best input type for a password field.
type="password"
Attribute that sets the maximum allowed length of text.
maxlength
Why would you use pattern even if you already have type="email"?
To enforce a stricter or custom format
<input type="number" min="18" max>
What’s wrong?
max is missing a value.
Which element represents a scalar measurement like a score or skill level?
<meter>
Best input type for picking a color value.
type="color"
Attribute that uses a regex to check the format of input.
pattern
If a field must start with a letter, would you use HTML alone or regex?
Regex / pattern attribute
<input list="colors">
but you forgot something. What element is missing?
<datalist id="colors">...</datalist>
Which element is used to display the result of a calculation in a form?
<output>
Best input type for entering a whole number like “age”.
type="number"
Attribute that shows example text inside an input before the user types.
placeholder
Why should you not rely only on client-side validation?
It can be bypassed; server-side validation is also needed for security.
<form>
<input id="age" type="text" min="18">
</form>
Why doesn’t min="18" work here?
min only works with numeric/date input types, not type="text".