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
Fill in the blank to remove all images. | $("img")__________ | .remove(); | ^ *\.remove\(\); *$ |
Remove all paragraphs including their tags. | $("p").remove(); | ^ *\$\(•p•\)\.remove\(\); *$ | |
Remove the text contents of all paragraphs but preserve the tags. | $("p").empty(); | ^ *\$\(•p•\)\.empty\(\); *$ | |
Remove all paragraphs, including their tags, whose class is removable. | $("p.removable").remove(); | ^ *\$\(•p\.removable•\)\.remove\(\); *$ | |
5. Drag-and-drop: Holding down the left mouse button, drag the pieces of code onto the screen to remove all paragraphs and ordered lists including their tags. | $("p").add("ol").remove(); | ||
Remove all the contents of a div whose ID is "d3". Preserve its tags. | $("div#d3").empty(); | $`(`"`div`#`d3`"`)`.`empty`(`)`; | |
Remove all images whose class is "extra". | $("img.extra").remove(); | ||
Remove all spans including their tags. | $("span").remove(); | ^ *\$\(•span•\)\.remove\(\); *$ | |
Remove the contents of all paragraphs of a certain class. Preserve the tags. Make up the class name. | $("p.details").empty(); | ^ *\$\(•p\..+•\)\.empty\(\); *$ | |
Remove an h4 heading including its tags. Make up its ID. | $("h4#minor").remove(); | ^ *\$\(•h4#.+•\)\.remove\(\); *$ | |
The following code has executed. Next, you want the h3 heading to say "Hi". Code it. | $("h3#greeting").empty(); | $("h3#greeting").text("Hi"); | ^ *\$\(•h3#greeting•\)\.text\(•Hi•\); *$ |
When the user clicks any image, it is removed. | $("img").on("click", function() { $(this).remove(); }); | ^ *\$\(•img•\)\.on\(•click•, function\(\) {\n *\$\(this\)\.remove\(\);\n *}\); *$ | |
Remove all images whose class is "extra". | $("img.extra").remove(); | ^ *\$\(•img\.extra•\)\.remove\(\); *$ | |
Remove all spans including their tags. | $("span").remove(); | ^ *\$\(•span•\)\.remove\(\); *$ | |
Remove the contents of all paragraphs of a certain class. Preserve the tags. Make up the class name. | $("p.details").empty(); | ^ *\$\(•p\..+•\)\.empty\(\); *$ | |
Remove an h4 heading including its tags. Make up its ID. | $("h4#minor").remove(); | ^ *\$\(•h4#.+•\)\.remove\(\); *$ | |
The following code has executed. Next, you want the h3 heading to say "Hi". Code it. | $("h3#greeting").empty(); | $("h3#greeting").text("Hi"); | ^ *\$\(•h3#greeting•\)\.text\(•Hi•\); *$ |
When the user clicks any image, it is removed. | $("img").on("click", function() { $(this).remove(); }); | ^ *\$\(•img•\)\.on\(•click•, function\(\) {\n *\$\(this\)\.remove\(\);\n *}\); *$ | |
http://jsfiddle.net/ASmarterWayToLearn/72v91aut/ | |||
http://jsfiddle.net/ASmarterWayToLearn/n9pcog8o/ |