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 all paragraphs whose class begins with 'main-' | $("p[class__='main-']") | ^ | ^ *\^ *$ |
Fill in the blank to select all paragraphs whose class begins with 'main-' | $("p[class^=______]") | 'main-' | ^ *◘main-◘ *$ |
Select all paragraphs whose class begins with 'main-' | $("p[class^='main-']") | ^ *\$\(•p\[class\^=◘main-◘\]•\) *$ | |
Select all images whose source ends in 'jpg' | $("img[src$='jpg']") | ^ *\$\(•img\[src\$=◘jpg◘\]•\) *$ | |
5. Drag-and-drop: Holding down the left mouse button, drag the pieces of code onto the screen to assign "_blank" as the target to all link anchors that begin with 'http:'. | $("a[href^='http:']").attr("target", "_blank"); | ||
Begin a selection that selects all images whose source contains particular text. | $("img[src*= | $`(`"`img`[`src`*`= | |
Select all h2 headings whose id begins with 'product'. | $("h2[id^='product']") | ||
Select images whose source contains a particular text fragment. Make up the text fragment. | $("img[src*='loris']") | ^ *\$\(•img\[src\*=◘.+◘\]•\) *$ | |
Select all blockquotes whose class begins with a particular set of characters. Make up the characters. | $("blockquote[class^='important']") | ^ *\$\(•blockquote\[class\^=◘.+◘\]•\) *$ | |
Select all headings of a particular size (your choice) whose class ends with particular characters. Make up the characters. | $("h3[class$='_pr']") | ^ *\$\(•h[1-4]\[class\$=◘.+◘\]•\) *$ | |
Select all paragraphs and all blockquotes whose class contains a particular text fragment. Make up the text fragment. | $("p[class*='big'], blockquote[class*='big']") | ^ *\$\(•p\[class\*=◘(.+)◘\], blockquote\[class\*=◘\1◘\]•\) *$ | |
Select all links that end in '.pdf' and force them to open in a new window. | $("a[href$='.pdf']").attr("target", "_blank"); | ^ *\$\(•a\[href\$=◘\.pdf◘\]•\)\.attr\(•target•, •_blank•\); *$ | |
Select all h2 headings whose id begins with 'product'. | $("h2[id^='product']") | ^ *\$\(•h2\[id\^=◘product◘\]•\) *$ | |
Select images whose source contains a particular text fragment. Make up the text fragment. | $("img[src*='loris']") | ^ *\$\(•img\[src\*=◘.+◘\]•\) *$ | |
Select all blockquotes whose class begins with a particular set of characters. Make up the characters. | $("blockquote[class^='important']") | ^ *\$\(•blockquote\[class\^=◘.+◘\]•\) *$ | |
Select all headings of a particular size (your choice) whose class ends with particular characters. Make up the characters. | $("h3[class$='_pr']") | ^ *\$\(•h[1-4]\[class\$=◘.+◘\]•\) *$ | |
Select all paragraphs and all blockquotes whose class contains a particular text fragment. Make up the text fragment. | $("p[class*='big'], blockquote[class*='big']") | ^ *\$\(•p\[class\*=◘(.+)◘\], blockquote\[class\*=◘\1◘\]•\) *$ | |
Select all links that end in '.pdf' and force them to open in a new window. | $("a[href$='.pdf']").attr("target", "_blank"); | ^ *\$\(•a\[href\$=◘\.pdf◘\]•\)\.attr\(•target•, •_blank•\); *$ | |
http://jsfiddle.net/ASmarterWayToLearn/j2975asy/ | |||
http://jsfiddle.net/ASmarterWayToLearn/jagm32u3/ |