HTML and CSS Reference
This section contains the solutions to the thought experiments and answers to the objective
review questions in this chapter.
Objective 3.1: Thought experiment
By using these techniques, you can get a reference to the input controls on the form and,
based on user input in certain elements, this can trigger modification to the validation rules
(for example, change the regular expression validation dynamically). You can get regional
context about a user from the Geolocation API. From this you can derive what part of the
world the user is in and apply the exact validation on the input controls.
Objective 3.1: Review
Correct answer: C
Incorrect: A radio button is suited for allowing a single selection.
Incorrect: A text area is suited for a multi-line text box.
Correct: Check boxes allow multiple selections.
Incorrect: A radio button doesn't allow more than one selection.
Correct answer: D
Incorrect: A text box allows data entry but is plainly visible.
Incorrect: A text area allows data entry but is plainly visible.
Incorrect: url is a type of text box with special validation rules.
Correct: A password input type hides the characters being entered.
Correct answer: B
Incorrect: A button is generic and must have an event handler to perform custom
Correct: The submit button invokes the forms submit action.
Incorrect: The reset button clears all input fields on the form.
Incorrect: A radio button is used for a selection list.