The next several exercises are timed. If you type slowly or dislike time pressure, feel free to increase the allotted time.
Name and email required. Check any number of boxes.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
0
0
0
0 | In the box on the right, type the method for adding a class, including the parentheses. | addClass() | ^ *addClass\(\) *$ | ||||
1 | Type the three characters that are missing in this statement. Type them in order, without typing spaces between them. | $("div")addClass(important); | ."" | ^ *\. *• *• *$ | |||
2 | You're adding the class "pretty" to all paragraphs. Fill in the blank. | ____addClass("pretty"); | $("p"). | ^ *\$\(•p•\)\. *$ | |||
3 | You're adding the class "pretty" to all paragraphs. Type the rest of the statement. | $("p") | .addClass("pretty"); | ^ *\.addClass\(•pretty•\); *$ | |||
4 | 5. Drag-and-drop: Holding down the left mouse button, drag the pieces of code onto the screen to add the class "pretty" to all divs. | $("div").addClass("pretty"); | $`(`"`div`"`)`.`add`Class`(`"``"`pretty`"`)`; | ||||
5 | Add the class "emphasized" to all divs and paragraphs. | $("div, p").addClass("emphasized"); | $`(`"`div`, `p`"`)`.`add`Class`(`"`emphasized`"`)`; | ||||
6 | Add the classes "formal" and "tinted" to all tables. | $("table").addClass("formal tinted"); | |||||
7 | Add the class "fancy" to all unordered lists. | $("ul").addClass("fancy"); | ^ *\$\(•ul•\)\.addClass\(•fancy•\); *$ | ||||
8 | Add the class "centered" to all images. | $("img").addClass("centered"); | ^ *\$\(•img•\)\.addClass\(•centered•\); *$ | ||||
9 | Add a class to all divs. Make up the class name. | $("div").addClass("normal"); | ^ *\$\(•div•\)\.addClass\(•.*•\); *$ | ||||
10 | Remove the class "dark" from all instances of a particular kind of element, like all paragraphs. You choose the kind of element. | $("p").removeClass("dark"); | ^ *\$\(•.*•\)\.removeClass\(•dark•\); *$ | ||||
11 | Remove two classes from two elements of your choice. Make up the class names. | $("div, p").removeClass("big bold"); | ^ *\$\(•.*, .*•\)\.removeClass\(•.* .*•\); *$ | ||||
12 | Add the classes "formal" and "tinted" to all tables. | $("table").addClass("formal tinted"); | ^ *\$\(•table•\)\.addClass\(•formal tinted•\); *$ | ||||
13 | Add the class "fancy" to all unordered lists. | $("ul").addClass("fancy"); | ^ *\$\(•ul•\)\.addClass\(•fancy•\); *$ | ||||
14 | Add the class "centered" to all images. | $("img").addClass("centered"); | ^ *\$\(•img•\)\.addClass\(•centered•\); *$ | ||||
15 | Add a class to all divs. Make up the class name. | $("div").addClass("normal"); | ^ *\$\(•div•\).addClass\(•.+•\); *$ | ||||
16 | Remove the class "dark" from all instances of a particular kind of element, like all paragraphs. You choose the kind of element. | $("p").removeClass("dark"); | ^ *\$\(•.*•\)\.removeClass\(•dark•\); *$ | ||||
17 | Remove two classes from two elements of your choice. Make up the class names. | $("div, p").removeClass("big bold"); | ^ *\$\(•.*, .*•\)\.removeClass\(•.* .*•\); *$ | ||||
18 | http://jsfiddle.net/ASmarterWayToLearn/cpLf6hg2/ | ||||||
19 | http://jsfiddle.net/ASmarterWayToLearn/hqwxh9vx/ |