HTML and CSS Reference
In-Depth Information
Answers
This section contains the solutions to the thought experiments and answers to the objective
review questions in this chapter.
Objective 3.1: Thought experiment
You've already seen how to get access to the DOM and modify elements through JavaScript.
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
1.
Incorrect: A radio button is suited for allowing a single selection.
A.
Incorrect: A text area is suited for a multi-line text box.
B.
Correct: Check boxes allow multiple selections.
C.
Incorrect: A radio button doesn't allow more than one selection.
D.
Correct answer: D
2.
Incorrect: A text box allows data entry but is plainly visible.
A.
Incorrect: A text area allows data entry but is plainly visible.
B.
Incorrect: url is a type of text box with special validation rules.
C.
Correct: A password input type hides the characters being entered.
D.
Correct answer: B
3.
Incorrect: A button is generic and must have an event handler to perform custom
logic.
A.
Correct: The submit button invokes the forms submit action.
B.
Incorrect: The reset button clears all input fields on the form.
C.
Incorrect: A radio button is used for a selection list.
D.
 
Search WWH ::




Custom Search