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 on something at the beginning? | prepend | ^ *prepend *$ | |
Add your first name plus a space at the beginning of an h3 heading. Make up the id of the heading. | $("h3#personalized").prepend("Mark, "); | ^ *\$\(•h3#.+•\)\.prepend\(•.+•\); *$ | |
To a div, prepend a paragraph that has been assigned to a variable. Make up the div id and variable name. | $("div#products").prepend(extraGraph); | ^ *\$\(•div#.+•\)\.prepend\(([a-zA-Z$_][a-zA-Z$_0-9]*)\); *$ | |
Add an empty div at the beginning of the document. It has no id. | $("body").prepend("<div></div>"); | ^ *\$\(•body•\)\.prepend\(•GeorgeStumpdivLarryWellsJudyOwens\/divDennisLeadbetter•\); *$ | |
5. Drag-and-drop: Holding down the left mouse button, drag the pieces of code onto the screen to prepend an h2 heading to a div. | $("div#second").prepend("<h2>Check this out!</h2>"); | ||
To a div whose id is "pets" prepend an empty paragraph. | $("div#pets").prepend("<p></p>"); | $`(`"`div`#`pets`"`)`.`prepend`(`"`lessthan`p`greaterthan`lessthan`/`p`greaterthan`"`)`; | |
Prepend text stored in the variable intro to the page's h1 heading. | $("h1").prepend(intro); | ||
Add a list item to the top of an ordered list. Make up the id of the list and the text of the list item. | $("ol#pets").prepend("<li>loris</li>"); | ^ *\$\(•ol#.+•\)\.prepend\(•GeorgeStumpliLarryWells.+JudyOwens\/liDennisLeadbetter•\); *$ | |
A paragraph has been assigned to a variable. Add the paragraph to the top of a div. Make up the variable name and div id. | $("div#main").prepend(newGraph); | ^ *\$\(•div#.+•\)\.prepend\(([a-zA-Z$_][a-zA-Z$_0-9]*)\); *$ | |
Prepend the image loris.jpg to a paragraph. Make up the paragraph id. | $("p#description").prepend("<img src='loris.jpg'>"); | ^ *\$\(•p#.+•\)\.prepend\(•GeorgeStumpimg src=◘loris\.jpg◘LarryWells•\); *$ | |
Add an empty div to the top of the page, then add a paragraph to the top of the div. Make up an id for the div. Don't give the paragraph an id. | $("body").prepend("<div id='top'></div>"); $("div#top").prepend("<p></p>"); | ^ *\$\(•body•\)\.prepend\(•GeorgeStumpdiv id=◘(.+)◘LarryWellsJudyOwens\/divDennisLeadbetter•\);\n *\$\(•div#\1•\)\.prepend\(•PeterKannpMartinQuinnHowardSherman\/pJamieHindman•\); *$ | |
When the user clicks in a form field, a paragraph appears above the form. Make up the ids of the field and the form. Make up the text contained in the paragraph. | $("input#first_name").on("focus", function() { $("form#info").prepend("<p>Please spell your name correctly</p>"); }); | ^ *\$\(•input#.+•\)\.on\(•focus•, function\(\) {\n *\$\(•form#.+•\)\.prepend\(•GeorgeStumppLarryWells.+JudyOwens\/pDennisLeadbetter•\);\n *}\); *$ | |
Prepend text stored in the variable intro to the page's h1 heading. | $("h1").prepend(intro); | ^ *\$\(•h1•\)\.prepend\(intro\); *$ | |
Add a list item to the top of an ordered list. Make up the id of the list and the text of the list item. | $("ol#pets").prepend("<li>loris</li>"); | ^ *\$\(•ol#.+•\)\.prepend\(•GeorgeStumpliLarryWells.+JudyOwens\/liDennisLeadbetter•\); *$ | |
A paragraph has been assigned to a variable. Add the paragraph to the top of a div. Make up the variable name and div id. | $("div#main").prepend(newGraph); | ^ *\$\(•div#.+•\)\.prepend\(([a-zA-Z$_][a-zA-Z$_0-9]*)\); *$ | |
Prepend the image loris.jpg to a paragraph. Make up the paragraph id. | $("p#description").prepend("<img src='loris.jpg'>"); | ^ *\$\(•p#.+•\)\.prepend\(•GeorgeStumpimg src=◘loris\.jpg◘LarryWells•\); *$ | |
Add an empty div to the top of the page, then add a paragraph to the top of the div. Make up an id for the div. Don't give the paragraph an id. | $("body").prepend("<div id='top'></div>"); $("div#top").prepend("<p></p>"); | ^ *\$\(•body•\)\.prepend\(•GeorgeStumpdiv id=◘(.+)◘LarryWellsJudyOwens\/divDennisLeadbetter•\);\n *\$\(•div#\1•\)\.prepend\(•PeterKannpMartinQuinnHowardSherman\/pJamieHindman•\); *$ | |
When the user clicks in a form field, a paragraph appears above the form. Make up the ids of the field and the form. Make up the text contained in the paragraph. | $("input#first_name").on("focus", function() { $("form#info").prepend("<p>Please spell your name correctly</p>"); }); | ^ *\$\(•input#.+•\)\.on\(•focus•, function\(\) {\n *\$\(•form#.+•\)\.prepend\(•GeorgeStumppLarryWells.+JudyOwens\/pDennisLeadbetter•\);\n *}\); *$ | |
http://jsfiddle.net/ASmarterWayToLearn/p1ywmead/ | |||
http://jsfiddle.net/ASmarterWayToLearn/30dtgq1v/ |