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
In the following code, paragraphs of the class "____" are selected. | $("p.main").addClass("big"); | main | ^ *main *$ |
Type the selector for tables that have the class "fancy". | $("table.fancy") | ^ *\$\(•table\.fancy•\) *$ | |
Type the selector for all elements that have the class "dark". | $(".dark") | ^ *\$\(•\.dark•\) *$ | |
Type the selector for divs that have the class "main" and all paragraphs. | $("div.main, p") | ^ *\$\(•div\.main, p•\) *$ | |
5. Drag-and-drop: Holding down the left mouse button, drag the pieces of code onto the screen to hide all images that have the class "optional" | $("img.optional").hide(); | ||
Hide all paragraphs that have the class "minor". | $("p.minor").hide(); | $`(`"`p`.`minor`"`)`.`hide`(`)`; | |
Hide all elements that have the class "extra" | $(".extra").hide(); | ||
Hide all ordered lists that have the class "tasks" | $("ol.tasks").hide(); | ^ *\$\(•ol\.tasks•\)\.hide\(\); *$ | |
Add the class "bold" to all paragraphs that have a particular class. Make up the name of the class that you're selecting. | $("p.important").addClass("bold"); | ^ *\$\(•p\..*•\)\.addClass\(•bold•\); *$ | |
Add a new class to all elements of a particular class. Make up both class names. | $(".special").addClass("pretty"); | ^ *\$\(•.*•\)\.addClass\(•.*•\); *$ | |
Selecting divs of the class "gonzo," remove that class. | $("div.gonzo").removeClass("gonzo"); | ^ *\$\(•div\.gonzo•\)\.removeClass\(•gonzo•\); *$ | |
Add two new classes to paragraphs of a particular class. Make up all three class names. | $("p.test").addClass("prominent special"); | ^ *\$\(•p\..*•\)\.addClass\(•.* .*•\)\; *$ | |
Hide all elements that have the class "extra" | $(".extra").hide(); | ^ *\$\(•\.extra•\)\.hide\(\); *$ | |
Hide all ordered lists that have the class "tasks" | $("ol.tasks").hide(); | ^ *\$\(•ol\.tasks•\)\.hide\(\); *$ | |
Add the class "bold" to all paragraphs that have a particular class. Make up the name of the class that you're selecting. | $("p.important").addClass("bold"); | ^ *\$\(•p\..*•\)\.addClass\(•bold•\); *$ | |
Add a new class to all elements of a particular class. Make up both class names. | $(".special").addClass("pretty"); | ^ *\$\(•.*•\)\.addClass\(•.*•\); *$ | |
Selecting divs of the class "gonzo," remove that class. | $("div.gonzo").removeClass("gonzo"); | ^ *\$\(•div\.gonzo•\)\.removeClass\(•gonzo•\); *$ | |
Add two new classes to paragraphs of a particular class. Make up all three class names. | $("p.test").addClass("prominent special"); | ^ *\$\(•p\..*•\)\.addClass\(•.* .*•\)\; *$ | |
http://jsfiddle.net/ASmarterWayToLearn/vcmcy266/ | |||
http://jsfiddle.net/ASmarterWayToLearn/p7t97yvc/ |