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
Rewrite the following code fragment, eliminating one character, to make it legal. | var my Name = | var myName = | ^ *var my[Nn]ame = *$ |
Rewrite the following code fragment to make it legal. | var "city" = | var city = | ^ *var city = *$ |
Type the illegal character in this code fragment. | var 1st_city = | 1 | ^ *1 *$ |
Rewrite the following code fragment using camelCase. | var lastmanstanding = | var lastManStanding = | ^ *var lastManStanding = *$ |
5. Drag-and-drop: Holding down the left mouse button, drag the pieces of code onto the screen to assemble a legal camelCase variable name. (There's more than one right answer.) | name1stAlias or nameAlias1st | ||
Write a legal variable name made up of "9" and "district". | district9 | district`9 | |
Assign all paragraphs to a variable that is named 12_building$a. Omit any illegal characters. | var _building$a = $("p"); | ||
Type a legal variable that begins with a character from the top row of keys that isn't an underline. | $name | ^ *\$([a-zA-Z$_0-9]*) *$ | |
Assign to a legally-named variable any paragraphs that contain some particular text content. Make up the variable name and text. | var target = $("p:contains('loris')"); | ^ *var ([a-zA-Z$_][a-zA-Z$_0-9]*) = \$\(•p:contains\(◘.+◘\)•\); *$ | |
A particular heading has been assigned to the variable headToChange. Change it to empty h4 tags without using empty(). | headToChange.html("<h4></h4>"); | ^ *headToChange\.html\(•GeorgeStumph4LarryWellsJudyOwens\/h4DennisLeadbetter•\); *$ | |
Assign a particular image--one that's hidden--to a legally-named variable, then display it using the variable as the selector. Make up the variable name and id. Use either of the methods you know to display the image. | var pic = $("img#hiddenLoris"); pic.show(); | ^ *var ([a-zA-Z$_][a-zA-Z$_0-9]*) = \$\(•img#.+•\);\n *\1\.(show|toggle)\(\); *$ | |
Assign a particular ordered list to a variable, using camelCase. On the next line assign a particular unordered list to another variable, using camelCase. Make up the variable names and ids. | var topNumbered = $("ol#cats"); var topBulleted = $("ul#dogs"); | ^ *var ([a-z$_]+[A-Za-z$_0-9]+) = \$\(•ol#.+•\);\n *var ([a-z$_]+[A-Za-z$_0-9]+) = \$\(•ul#.+•\); *$ | |
Assign all paragraphs to a variable that is named 12_building$a. Omit any illegal characters. | var _building$a = $("p"); | ^ *var _building\$a = \$\(•p•\); *$ | |
Type a legal variable that begins with a character from the top row of keys that isn't an underline. | $name | ^ *\$([a-zA-Z$_0-9]*) *$ | |
Assign to a legally-named variable any paragraphs that contain some particular text content. Make up the variable name and text. | var target = $("p:contains('loris')"); | ^ *var ([a-zA-Z$_][a-zA-Z$_0-9]*) = \$\(•p:contains\(◘.+◘\)•\); *$ | |
A particular heading has been assigned to the variable headToChange. Change it to empty h4 tags without using empty(). | headToChange.html("<h4></h4>"); | ^ *headToChange\.html\(•GeorgeStumph4LarryWellsJudyOwens\/h4DennisLeadbetter•\); *$ | |
Assign a particular image--one that's hidden--to a legally-named variable, then display it using the variable as the selector. Make up the variable name and id. Use either of the methods you know to display the image. | var pic = $("img#hiddenLoris"); pic.show(); | ^ *var ([a-zA-Z$_][a-zA-Z$_0-9]*) = \$\(•img#.+•\);\n *\1\.(show|toggle)\(\); *$ | |
Assign a particular ordered list to a variable, using camelCase. On the next line assign a particular unordered list to another variable, using camelCase. Make up the variable names and ids. | var topNumbered = $("ol#cats"); var topBulleted = $("ul#dogs"); | ^ *var ([a-z$_]+[A-Za-z$_0-9]+) = \$\(•ol#.+•\);\n *var ([a-z$_]+[A-Za-z$_0-9]+) = \$\(•ul#.+•\); *$ | |
http://jsfiddle.net/ASmarterWayToLearn/d17113Ln/ | |||
http://jsfiddle.net/ASmarterWayToLearn/unhwaez5/ |