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 replace the paragraph. | $("p#p1")__________("<p>Lorises rule!</p>"); | .replaceWith | ^ *\.replaceWith *$ |
In the following code, what will be lost? Answer with four characters. | $("p#p1").replaceWith("Lorises rule!"); | tags | ^ *tags *$ |
In the following code, fill in the blank to replace the paragraph with an empty paragraph that has no id. | $("p#p1")____________________ | .replaceWith("<p></p>"); | ^ *\.replaceWith\(•GeorgeStumppLarryWellsJudyOwens\/pDennisLeadbetter•\); *$ |
Replace a paragraph whose id is "p1" with an empty paragraph that has no id. | $("p#p1").replaceWith("<p></p>"); | ^ *\$\(•p#p1•\)\.replaceWith\(•GeorgeStumppLarryWellsJudyOwens\/pDennisLeadbetter•\); *$ | |
replace a paragraph whose id is "greeting" with a paragraph saying "Hi". | $("p#greeting").replaceWith("<p>Hi</p>"); | ||
Replace a paragraph whose id is "p1" with an empty paragraph without an id. | $("p#p1").replaceWith("<p></p>"); | $`(`"`p`#`p1`"`)`.`replace`With`(`"`lessthan`p`greaterthan`lessthan`/`p`greaterthan`"`)`; | |
Replace a paragraph whose id is "greeting" with a paragraph with no id that says "Hi". | $("p#greeting").replaceWith(" Hi "); | ||
Replace a paragraph whose id is "gonzo" with the word "Bye," losing the paragraph tags. (Not that you'd want to do this.) | $("p#gonzo").replaceWith("Bye"); | ^ *\$\(•p#gonzo•\)\.replaceWith\(•Bye•\); *$ | |
Replace an h3 heading with an h2 heading. The second heading has no id. Make up the id of the first heading and some text for the second heading. | $("h3#replaceable").replaceWith("<h2>Hello there.</h2>"); | ^ *\$\(•h3#.+•\)\.replaceWith\(•.+<\/h2>•\); *$ | |
Replace a paragraph with another paragraph. They have different ids. Make up the ids as well as the text for the replacement paragraph. (Use single quotes to assign the id of the replacement paragraph.) | $("p#p1").replaceWith("<p id='p2'>Boo!</p>"); | ^ *\$\(•p#.+•\)\.replaceWith\(• .+<\/p>•\); *$ | |
When a paragraph is clicked, replace it with another paragraph including some text. Make up the first paragraph's id. The replacement paragraph doesn't have one. | $("p#temp").on("click", function() { $(this).replaceWith("<p>New text</p>"); }); | ^ *\$\(•p#.+•\)\.on\(•click•, function\(\) {\n *\$\(this\)\.replaceWith\(• .+<\/p>•\);\n *}\); *$ | |
Replace all h2 headings with untagged text that says "New!". (Not that you'd want to do this.) | $("h2").replaceWith("New!"); | ^ *\$\(•h2•\)\.replaceWith\(•New\!•\); *$ | |
Replace a paragraph whose id is "greeting" with a paragraph with the same id that says "Hi". | $("p#greeting").replaceWith("<p id='greeting'>Hi</p>"); | ^ *\$\(•p#greeting•\)\.replaceWith\(•GeorgeStumpp id=◘greeting◘LarryWellsHiJudyOwens\/pDennisLeadbetter•\); *$ | |
Replace a paragraph whose id is "gonzo" with the word "Bye," losing the paragraph tags. (Not that you'd want to do this.) | $("p#gonzo").replaceWith("Bye"); | ^ *\$\(•p#gonzo•\)\.replaceWith\(•Bye•\); *$ | |
Replace an h3 heading with an h2 heading. The second heading has no id. Make up the id of the first heading and some text for the second heading. | $("h3#replaceable").replaceWith("<h2>Hello there.</h2>"); | ^ *\$\(•h3#.+•\)\.replaceWith\(•.+<\/h2>•\); *$ | |
Replace a paragraph with another paragraph. They have different ids. Make up the ids as well as the text for the replacement paragraph. (Use single quotes to assign the id of the replacement paragraph.) | $("p#p1").replaceWith("<p id='p2'>Boo!</p>"); | ^ *\$\(•p#.+•\)\.replaceWith\(• .+<\/p>•\); *$ | |
When a paragraph is clicked, replace it with another paragraph including some text. Make up the first paragraph's id. The replacement paragraph doesn't have one. | $("p#temp").on("click", function() { $(this).replaceWith("<p>New text</p>"); }); | ^ *\$\(•p#.+•\)\.on\(•click•, function\(\) {\n *\$\(this\)\.replaceWith\(• .+<\/p>•\);\n *}\); *$ | |
Replace all h2 headings with untagged text that says "New!". (Not that you'd want to do this.) | $("h2").replaceWith("New!"); | ^ *\$\(•h2•\)\.replaceWith\(•New\!•\); *$ | |
http://jsfiddle.net/ASmarterWayToLearn/v1kdp2tg/ | |||
http://jsfiddle.net/ASmarterWayToLearn/ssj5nvc7/ |