1. Write the opening tag for the easy way to code a label.
That's correct. Well done!
The correct code:
<label>
Press Tab or click button to advance to next exercise.
2. Type the character that comes immediately before the closing label tag.
<label><input type="radio" name="animals" value="ox"> ox
That's correct. Well done!
The correct answer:
x
The closing label tag comes at the very end.
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
3. Fill in the blank.
<input type="radio" name="gender" id="r1"
value="female"><label for=____>Female</label>
That's correct. Well done!
The correct code:
"r1"
Press Tab or click button to advance to next exercise.
4. Fill in the blank.
<label ____"surname">Last name</label>
That's correct. Well done!
The correct code:
for=
Press Tab or click button to advance to next exercise.
5. Drag-and-drop: Holding down the left mouse button, drag the pieces of code onto the screen to code a label.
6. Click in the box and type the next character. I'll autocomplete. Don't type spaces or carriage returns. When the exercise is complete, I'll turn the exercise number green.
Coding the hard way, code a label for an element with the ID of "c2". Code opening and closing tags and include the label text, which is Married.
That's correct. Well done!
Press Tab or click button to advance to next exercise.
7. Fail-safe coding. If you type the wrong character, I'll cancel the keystroke. Type spaces. When the exercise is complete, I'll turn the exercise number green.
Coding the easy way, revise the following code to include a label. End with the closing label tag.
name: <input type="text">
Press Tab or click button to advance to next exercise.
That's correct. Well done!
8. Code the opening label tag for the easy way to code a label.
That's correct. Well done!
The correct code:
<label>
Press Tab or click button to advance to next exercise.
9. If the following is the control, code the opening label tag using the hard way to code a label.
Last name: <input type="text" id="f2" size="25"
maxlength="40">
That's correct. Well done!
The correct code:
<label for="f2">
Press Tab or click button to advance to next exercise.
10. Code the opening and closing tags for a label the hard way. Make up what you need to.
That's correct. Well done!
Example:
<label for="city"></label>
Press Tab or click button to advance to next exercise.
11. Code a multi-line text box. Size it using numbers of your choice but don't bother with an ID or name. Give it a label the easy way.
That's correct. Well done!
Example:
<label><textarea rows="10" cols="50"></textarea></label>
Press Tab or click button to advance to next exercise.
12. Re-code this adding a label the hard way. The label text is Male
<input type="checkbox" name="gender" id="m">
That's correct. Well done!
The correct code:
<input type="checkbox" name="gender" id="m"><label for="m">Male</label>
Press Tab or click button to advance to next exercise.
The next several exercises are timed. If you type slowly or dislike time pressure, feel free to increase the allotted time.
13. Time goal: 40 seconds. Coding the easy way, revise the following code to include a label. End with the closing label tag.
Name: <input type="text">
Press Tab or click button to check answer.
The correct code:
<label>Name: <input type="text"></label>
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
14. Time goal: 15 seconds. Code the opening label tag for the easy way to code a label.
Press Tab or click button to check answer.
The correct code:
<label>
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
15. Time goal: 20 seconds. If the following is the control, code the opening label tag using the hard way to code a label.
Last name: <input type="text" id="f2" size="25"
maxlength="40">
Press Tab or click button to check answer.
The correct code:
<label for="f2">
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
16. Time goal: 15 seconds. Code the opening and closing tags for a label the hard way. Make up what you need to.
Press Tab or click button to check answer.
Example:
<label for="city"></label>
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
17. Time goal: 50 seconds. Code a multi-line text box. Size it using numbers of your choice but don't bother with an ID or name. Give it a label the easy way.
Press Tab or click button to check answer.
Example:
<label><textarea rows="10" cols="50"></label>
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
18. Time goal: 75 seconds. Re-code this adding a label the hard way. The label text is Male
<input type="checkbox" name="gender" id="m">
Press Tab or click button to check answer.
The correct code:
<input type="checkbox" name="gender" id="m"><label for="m">Male</label>
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
19. Access this live coding exercise at JS Fiddle. When you've completed the exercise, close the JS Fiddle window, and you'll be returned to this page. (If JS Fiddle displays a warning message saying that your changes will be reset, click Leave this Page.)
Click button to advance.
20. Access this live coding exercise at JS Fiddle. When you've completed the exercise, close the JS Fiddle window, and you'll be returned to this page. (If JS Fiddle displays a warning message saying that your changes will be reset, click Leave this Page.)
Click button to advance.
Post a review on Amazon for the paperback or the Kindle edition.
Email me to give me a compliment, complaint, or correction. I'll respond.
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
1
0