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 any headings that contain "Hello Dude". | $("h3______('Hello, Dude')") | :contains | ^ *:contains *$ |
Fill in the blank to select any headings that contain "Hello Dude". | $("h3:contains_____________") | ('Hello Dude') | ^ *\(◘Hello Dude◘\) *$ |
Fill in the blank to select any headings that contain "Hello Dude". | $("h3:contains_______________ | ('Hello Dude')") | ^ *\(◘Hello Dude◘\)•\) *$ |
Select any paragraphs that contain "Wow". | $("p:contains('Wow')") | ^ *\$\(•p:contains\(◘Wow◘\)•\) *$ | |
5. Drag-and-drop: Holding down the left mouse button, drag the pieces of code onto the screen to replace text in any h3 heading that contains "Warning". | $("h3:contains('Warning')").text("Important"); | ||
Select all divs that contain the string represented by the variable segment. | $("div:contains(segment)") | $`(`"`div`:`contains`(`segment`)`"`) | |
Code the first part of a selection, up to the end of contains. You're checking all paragraphs whose class is temp. | $("p.temp:contains | ||
Add a class to any unordered lists that contain "vital". Make up the class name. | $("ul:contains('vital')").addClass("bold"); | ^ *\$\(•ul:contains\(◘vital◘\)•\)\.addClass\(•.+•\); *$ | |
Remove any divs that contain "classified". | $("div:contains('classified')").remove(); | ^ *\$\(•div:contains\(◘classified◘\)•\)\.remove\(\); *$ | |
If an h3 heading containing "hint" is displayed, stop displaying it. If it isn't displayed, display it. | $("h3:contains('hint')").toggle(); | ^ *\$\(•h3:contains\(◘hint◘\)•\)\.toggle\(\); *$ | |
If any paragraphs contain "hazard" replace their class with "bold". | $("p:contains('hazard')").attr("class", "bold"); | ^ *\$\(•p:contains\(◘hazard◘\)•\)\.attr\(•class•, •bold•\); *$ | |
If a div whose id is "spell" contains "cadabra" turn it into an empty div using empty(). | $("div#spell:contains('cadabra')").empty(); | ^ *\$\(•div#spell:contains\(◘cadabra◘\)•\)\.empty\(\); *$ | |
Select all paragraphs whose class is "temp" and that contain "cat". | $("p.temp:contains('cat')") | ^ *\$\(•p\.temp:contains\(◘cat◘\)•\) *$ | |
Add a class to any unordered lists that contain "vital". Make up the class name. | $("ul:contains('vital')").addClass("bold"); | ^ *\$\(•ul:contains\(◘vital◘\)•\)\.addClass\(•.+•\); *$ | |
Remove any divs that contain "classified". | $("div:contains('classified')").remove(); | ^ *\$\(•div:contains\(◘classified◘\)•\)\.remove\(\); *$ | |
If an h3 heading containing "hint" is displayed, stop displaying it. If it isn't displayed, display it. | $("h3:contains('hint')").toggle(); | ^ *\$\(•h3:contains\(◘hint◘\)•\)\.toggle\(\); *$ | |
If any paragraphs contain "hazard" replace their class with "bold". | $("p:contains('hazard')").attr("class", "bold"); | ^ *\$\(•p:contains\(◘hazard◘\)•\)\.attr\(•class•, •bold•\); *$ | |
If a div whose id is "spell" contains "cadabra" turn it into an empty div using empty(). | $("div#spell:contains('cadabra')").empty(); | ^ *\$\(•div#spell:contains\(◘cadabra◘\)•\)\.empty\(\); *$ | |
http://jsfiddle.net/ASmarterWayToLearn/twedm44s/ | |||
http://jsfiddle.net/ASmarterWayToLearn/tvL2wy3w/ |