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 even rows. | $("___even") | tr: | ^ *tr: *$ |
Fill in the blank to select odd rows. | $(________) | "tr:odd" | ^ *•tr:odd• *$ |
Select odd rows. | $("tr:odd") | ^ *\$\(•tr:odd•\) *$ | |
Select even rows in all tables of the class "fancy". | $("table.fancy tr:even") | ^ *\$\(•table\.fancy tr:even•\) *$ | |
5. Drag-and-drop: Holding down the left mouse button, drag the pieces of code onto the screen to specify a background-color of grey for even rows. | $("tr:even").css("background-color", "#ccc"); | ||
Specify a background color of "pink" for odd rows. | $("tr:odd").css("background-color", "pink"); | $`(`"`tr`:`odd`"`)`.`css`(`"`background-color`"`comma`1space"`pink`"`)`; | |
Assign the class "shaded" to even rows. | $("tr:even").attr("class", "shaded"); | ||
Background-color even or odd rows (your choice) a color of your choice using a word for the color. | $("tr:odd").css("background-color", "blue"); | ^ *\$\(•tr:(odd|even)•\)\.css\(•background-color•, •.+•\); *$ | |
Background-color odd rows of a particular table #ccc. Make up the id of the table. | $("table#pets tr:odd").css("background-color", "#ccc"); | ^ *\$\(•table#.+ tr:odd•\)\.css\(•background-color•, •#ccc•\); *$ | |
Background-color odd rows of two tables with a color word of your choosing. Make up the ids of the tables. | $("table#pets tr:odd, table#wild tr:odd").css("background-color", "grey"); | ^ *\$\(•table#.+ tr:odd, table#.+ tr:odd•\)\.css\(•background-color•, •.+•\); *$ | |
Assign a class to even or odd rows (your choice). Make up the name of the class. | $("tr:even").attr("class", "shaded_row"); | ^ *\$\(•tr:(even|odd)•\)\.attr\(•class•, •.+•\); *$ | |
Assign a class to even or odd rows (your choice) in a class of tables. Make up both class names. | $("table.fancy tr:odd").attr("class", "shaded"); | ^ *\$\(•table\..+ tr:(odd|even)•\)\.attr\(•class•, •.+•\); *$ | |
Assign the class "shaded" to even rows. | $("tr:even").attr("class", "shaded"); | ^ *\$\(•tr:even•\)\.attr\(•class•, •shaded•\); *$ | |
Background-color even or odd rows (your choice) a color of your choice using a word for the color. | $("tr:odd").css("background-color", "blue"); | ^ *\$\(•tr:(odd|even)•\)\.css\(•background-color•, •.+•\); *$ | |
Background-color odd rows of a particular table #ccc. Make up the id of the table. | $("table#pets tr:odd").css("background-color", "#ccc"); | ^ *\$\(•table#.+ tr:odd•\)\.css\(•background-color•, •#ccc•\); *$ | |
Background-color odd rows of two tables with a color word of your choosing. Make up the ids of the tables. | $("table#pets tr:odd, table#wild tr:odd").css("background-color", "grey"); | ^ *\$\(•table#.+ tr:odd, table#.+ tr:odd•\)\.css\(•background-color•, •.+•\); *$ | |
Assign a class to even or odd rows (your choice). Make up the name of the class. | $("tr:even").attr("class", "shaded_row"); | ^ *\$\(•tr:(even|odd)•\)\.attr\(•class•, •.+•\); *$ | |
Assign a class to even or odd rows (your choice) in a class of tables. Make up the class names. | $("table.fancy tr:odd").attr("class", "shaded"); | ^ *\$\(•table\..+ tr:(odd|even)•\)\.attr\(•class•, •.+•\); *$ | |
http://jsfiddle.net/ASmarterWayToLearn/zctz835o/ | |||
http://jsfiddle.net/ASmarterWayToLearn/fzv155po/ |