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
Using the filter() method, fill in the blank to select all paragraphs whose class is "special". | $("p").______(".special") | filter | ^ *filter *$ |
Using the filter() method, fill in the blank to select all paragraphs whose class is "special". | $("p").filter("_______") | .special | ^ *\.special *$ |
Using the filter() method, fill in the blank to select all paragraphs whose class is "special". | $("p")____________ | .filter(".special") | ^ *\.filter\(•\.special•\) *$ |
Using the filter() method, select all paragraphs whose class is "special". | $("p").filter(".special") | ^ *\$\(•p•\)\.filter\(•\.special•\) *$ | |
5. Drag-and-drop: Holding down the left mouse button, drag the pieces of code onto the screen to select all input fields whose class is "required" and give them a yellow background-color. | $("input").filter(".required").css("background-color", "yellow"); | ||
Using the filter() method, select all images whose class is "principal". | $("img").filter(".principal") | $`(`"`img`"`)`.`filter`(`"`.`principal`"`) | |
Using the filter() method, select the third child of all list items whose class is "plans". | $("li").filter(".plans:nth-child(3)" | ||
Using the filter() method, select the first paragraph of every parent. | $("p").filter(":first-of-type") | ^ *\$\(•p•\)\.filter\(•:first-of-type•\) *$ | |
Using the filter method, select even rows of a table. | $("tr").filter(":even") | ^ *\$\(•tr•\)\.filter\(•:even•\) *$ | |
Using the filter() method, select a class of images and toggle that class. Make up the class name. | $("img").filter(".visible").toggleClass("visible"); | ^ *\$\(•img•\)\.filter\(•\.(.+)•\)\.toggleClass\(•\1•\); *$ | |
Using the filter method, select a particular table. Make up the table's id. | $("table").filter("#occupations") | ^ *\$\(•table•\)\.filter\(•#.+•\) *$ | |
Using the filter() method, select images of a certain class. When an image of that class is clicked, animate it off the top of the screen by changing its margin to -1000 pix. Make up the class name. | $("img").filter(".fly_up").on("click", function() { $(this).animate({marginTop: "-=1000px"}); }); | ^ *\$\(•img•\)\.filter\(•\..+•\)\.on\(•click•, function\(\) {\n *\$\(this\)\.animate\({marginTop: •-=1000px•}\);\n}\); *$ | |
Using the filter() method, select the third child of all list items whose class is "plans". | $("li").filter(".plans:nth-child(3)") | ^ *\$\(•li•\)\.filter\(•\.plans:nth-child\(3\)•\) *$ | |
Using the filter() method, select the first paragraph of every parent. | $("p").filter(":first-of-type") | ^ *\$\(•p•\)\.filter\(•:first-of-type•\) *$ | |
Using the filter method, select even rows of a table. | $("tr").filter(":even") | ^ *\$\(•tr•\)\.filter\(•:even•\) *$ | |
Using the filter() method, select a class of images and toggle that class. Make up the class name. | $("img").filter(".visible").toggleClass("visible"); | ^ *\$\(•img•\)\.filter\(•\.(.+)•\)\.toggleClass\(•\1•\); *$ | |
Using the filter method, select a particular table. Make up the table's id. | $("table").filter("#occupations") | ^ *\$\(•table•\)\.filter\(•#.+•\) *$ | |
Using the filter() method, select images of a certain class. When an image of that class is clicked, animate it off the top of the screen by changing its margin to -1000 pix. Make up the class name. | $("img").filter(".fly_up").on("click", function() { $(this).animate({marginTop: "-=1000px"}); }); | ^ *\$\(•img•\)\.filter\(•\..+•\)\.on\(•click•, function\(\) {\n *\$\(this\)\.animate\({marginTop: •-=1000px•}\);\n}\); *$ | |
http://jsfiddle.net/ASmarterWayToLearn/wm14ewph/ | |||
http://jsfiddle.net/ASmarterWayToLearn/894m2189/ |