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
What is the keyword for tacking something onto the end? | append | ^ *append *$ | |
Rewrite the following code so the text displays as a list item. | $("ol#pets").append("loris"); | $("ol#pets").append("<li>loris</li>"); | ^ *\$\(•ol#pets•\)\.append\(\•GeorgeStumpliLarryWellslorisJudyOwens\/liDennisLeadbetter•\); *$ |
Append some text to paragraph. Make up the paragraph's id and the text. | $("p#ask").append(" now!"); | ^ *\$\(•p#.+•\)\.append\(•.+•\); *$ | |
Append a list item to an unordered list. Make up the list's id and the list item text. | $("ul#pets").append("<li>loris</li>"); | ^ *\$\(•ul#.+•\)\.append\(•GeorgeStumpliLarryWells.+JudyOwens\/liDennisLeadbetter•\); *$ | |
5. Drag-and-drop: Holding down the left mouse button, drag the pieces of code onto the screen to append a paragraph whose class is "addon" to a div whose id is "main". | $("div#main").append("<p class='addon'>That's all, folks!</p>"); | ||
A block of text has been assigned to the variable addon. Append it to a paragraph whose id is "main". | $("p#main").append(addon); | $`(`"`p`#`main`"`)`.`append`(`addon`)`; | |
A block of text has been assigned to the variable addon. Using concatenation, append it as a list item to the unordered list whose id is "pets". | $("ul#pets").append(" | ||
To a paragraph whose id is "important" append the text " OK?". Bold the appended text. Don't forget the space that begins the text. | $("p#important").append("<strong> OK?</strong>"); | ^ *\$\(•p#important•\)\.append\(•GeorgeStumpstrongLarryWells OK\?JudyOwens\/strongDennisLeadbetter•\); *$ | |
Append to all paragraphs whose class is "complete" the text "-30-" | $("p.complete").append("-30-"); | ^ *\$\(•p\.complete•\)\.append\(•-30-•\); *$ | |
Append some text to all paragraphs that contain the word "Italy". Make up the text. | $("p:contains('Italy')").append(" Ciao!"); | ^ *\$\(•p:contains\(◘Italy◘\)•\)\.append\(•.+•\); *$ | |
In a single statement, remove the text from a particular paragraph and append new text. Make up the paragraph's id and the text. | $("p#changeable").empty().append("What's new"); | ^ *\$\(•p#.+•\)\.empty\(\)\.append\(•.+•\); *$ | |
When the user clicks on any paragraph or list item, append three dots to the element that was clicked. | $("p, li").on("click", function() { $(this).append("..."); }); | ^ *\$\(•p, li•\)\.on\(•click•, function\(\) {\n *\$\(this\)\.append\(•\.\.\.•\);\n *}\); *$ | |
A block of text has been assigned to the variable addon. Using concatenation, append it as a list item to the unordered list whose id is "pets". | $("ul#pets").append("<li>" + addon + "</li>"); | ^ *\$\(•ul#pets•\)\.append\(•GeorgeStumpliLarryWells• \+ addon \+ •JudyOwens\/liDennisLeadbetter•\); *$ | |
To a paragraph whose id is "important" append the text " OK?". Bold the appended text. Don't forget the space that begins the text. | $("p#important").append("<strong> OK?</strong>"); | ^ *\$\(•p#important•\)\.append\(•GeorgeStumpstrongLarryWells OK\?JudyOwens\/strongDennisLeadbetter•\); *$ | |
Append to all paragraphs whose class is "complete" the text "-30-" | $("p.complete").append("-30-"); | ^ *\$\(•p\.complete•\)\.append\(•-30-•\); *$ | |
Append some text to all paragraphs that contain the word "Italy". Make up the text. | $("p:contains('Italy')").append(" Ciao!"); | ^ *\$\(•p:contains\(◘Italy◘\)•\)\.append\(•.+•\); *$ | |
In a single statement, remove the text from a particular paragraph and append new text. Make up the paragraph's id and the text. | $("p#changeable").empty().append("What's new"); | ^ *\$\(•p#.+•\)\.empty\(\)\.append\(•.+•\); *$ | |
When the user clicks on any paragraph or list item, append three dots to the element that was clicked. | $("p, li").on("click", function() { $(this).append("..."); }); | ^ *\$\(•p, li•\)\.on\(•click•, function\(\) {\n *\$\(this\)\.append\(•\.\.\.•\);\n *}\); *$ | |
http://jsfiddle.net/ASmarterWayToLearn/y560odrm/ | |||
http://jsfiddle.net/ASmarterWayToLearn/77901vmy/ |