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 select images that are the third child of a parent. | $("img:___child(3)") | nth- | ^ *nth- *$ |
Fill in the blank to select images that are the third child of a parent. | $("___________(3)") | img:nth-child | ^ *img:nth-child *$ |
Select images that are the third child of a parent. | $("img:nth-child(3)") | ^ *\$\(•img:nth-child\(3\)•\) *$ | |
Select all divs that are the second div of a parent. | $("div:nth-of-type(2)") | ^ *\$\(•div:nth-of-type\(2\)•\) *$ | |
5. Drag-and-drop: Holding down the left mouse button, drag the pieces of code onto the screen to select all paragraphs that are the fourth paragraph of a parent. | $("p:nth-of-type(4)"); | ||
Select all paragraphs that are the third children of parents. | $("p:nth-child(3)") | $`(`"`p`:`nth`-`child`(`3`)`"`) | |
Select all paragraphs that are the third paragraph of parents. | $("p:nth-of-type(3)") | ||
Select all list items that are the second child of parents. | $("li:nth-child(2)") | ^ *\$\(•li:nth-child\(2\)•\) *$ | |
Select all ordered lists that are the second ordered list of a parent. | $("ol:nth-of-type(2)") | ^ *\$\(•ol:nth-of-type\(2\)•\) *$ | |
Select all paragraphs that are the second child of a parent and all images that are the second image of a parent. | $("p:nth-child(2), img:nth-of-type(2)") | ^ *\$\(•p:nth-child\(2\), img:nth-of-type\(2\)•\) *$ | |
Select all paragraphs that are the second, third, or fourth paragraph of a parent (your choice), and delete their text content. | $("p:nth-of-type(2)").empty(); | ^ *\$\(•p:nth-of-type\((2|3|4)\)•\)\.empty\(\); *$ | |
Select all paragraphs that are the second, third, or fourth child of a parent (your choice), and replace their text content. Make up the text. | $("p:nth-child(3)").replaceWith("Hello world!"); | ^ *\$\(•p:nth-child\((2|3|4)\)•\)\.replaceWith\(•.+•\); *$ | |
Select all paragraphs that are the third paragraph of parents. | $("p:nth-of-type(3)") | ^ *\$\(•p:nth-of-type\(3\)•\) *$ | |
Select all list items that are the second child of parents. | $("li:nth-child(2)") | ^ *\$\(•li:nth-child\(2\)•\) *$ | |
Select all ordered lists that are the second ordered list of a parent. | $("ol:nth-of-type(2)") | ^ *\$\(•ol:nth-of-type\(2\)•\) *$ | |
Select all paragraphs that are the second child of a parent and all images that are the second image of a parent. | $("p:nth-child(2), img:nth-of-type(2)") | ^ *\$\(•p:nth-child\(2\), img:nth-of-type\(2\)•\) *$ | |
Select all paragraphs that are the second, third, or fourth paragraph of a parent (your choice), and delete their text content. | $("p:nth-of-type(2)").empty(); | ^ *\$\(•p:nth-of-type\((2|3|4)\)•\)\.empty\(\); *$ | |
Select all paragraphs that are the second, third, or fourth child of a parent (your choice), and replace their text content. Make up the text. | $("p:nth-child(3)").replaceWith("Hello world!"); | ^ *\$\(•p:nth-child\((2|3|4)\)•\)\.replaceWith\(•.+•\); *$ | |
http://jsfiddle.net/ASmarterWayToLearn/e1j2n0m1/ | |||
http://jsfiddle.net/ASmarterWayToLearn/01ugrs6d/ |