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
To include an element added by jQuery in a listener, you ________. | delegate | ^ *[d|D]elegate *$ | |
Fill in the blank to listen for an event for all paragraphs in the div, original and added. | $("div#products").on("click", ______ function() { | "p", | ^ *•p•, *$ |
Fill in the blank to listen for a click event for all paragraphs in the div, original and added. | $("div#products").on____________ function() { | ("click", "p", | ^ *\(•click•, •p•, *$ |
Listen for an event for all paragraphs, original and added, in a div whose id is "p2". | $("div#p2").on("click", "p", function() { | ^ *\$\(•div#p2•\)\.on\(•click•, •p•, function\(\) { *$ | |
5. Drag-and-drop: Holding down the left mouse button, drag the pieces of code onto the screen to listen for a mouseover on any image, original or added, on the page. | $("body").on("mouseover", "img", function() { | ||
Listen for a mouseenter for any ordered list on the page, original or added. | $("body").on("mouseenter", "ol", function() { | $`(`"`body`"`)`.`on`(`"`mouseenter`"`comma`1space"`ol`"`comma`1spacefunction`(`)`1space{ | |
Listen for a user clicking in a field, original or added, in a form whose class is "info". | $("form.info").on("focus", "input", function() { | ||
Listen for a mouseout on any div, original or added. | $("body").on("mouseout", "div", function() { | ^ *\$\(•body•\)\.on\(•mouseout•, •div•, function\(\) { *$ | |
Listen for a click on any image, original or added, in a particular div. Make up the id of the div. | $("div#main").on("click", "img", function() { | ^ *\$\(•div#.+•\)\.on\(•click•, •img•, function\(\) { *$ | |
Listen for a click on any list item, original or added, in an unordered list of a particular class. Make up the class name. | $("ul.pets").on("click", "li", function() { | ^ *\$\(•ul\..+•\)\.on\(•click•, •li•, function\(\) { *$ | |
Listen for a mouseover on an image of a particular class in a div of a particular class. Make up the class names. | $("div.products").on("mouseover", "img.main", function() { | ^ *\$\(•div\..+•\)\.on\(•mouseover•, •img\..+•, function\(\) { *$ | |
When the user clicks on a paragraph, original or added, anywhere in the document, slide it up out of view. | $("body").on("click", "p", function() { $(this).slideUp(); }); | ^ *\$\(•body•\)\.on\(•click•, •p•, function\(\) {\n *\$\(this\)\.slideUp\(\);\n}\); *$ | |
Listen for a user clicking in a field, original or added, in a form whose class is "info". | $("form.info").on("focus", "input", function() { | ^ *\$\(•form\.info•\)\.on\(•focus•, •input•, function\(\) { *$ | |
Listen for a mouseout on any div, original or added. | $("body").on("mouseout", "div", function() { | ^ *\$\(•body•\)\.on\(•mouseout•, •div•, function\(\) { *$ | |
Listen for a click on any image, original or added, in a particular div. Make up the id of the div. | $("div#main").on("click", "img", function() { | ^ *\$\(•div#.+•\)\.on\(•click•, •img•, function\(\) { *$ | |
Listen for a click on any list item, original or added, in an unordered list of a particular class. Make up the class name. | $("ul.pets").on("click", "li", function() { | ^ *\$\(•ul\..+•\)\.on\(•click•, •li•, function\(\) { *$ | |
Listen for a mouseover on an image of a particular class in a div of a particular class. Make up the class names. | $("div.products").on("mouseover", "img.main", function() { | ^ *\$\(•div\..+•\)\.on\(•mouseover•, •img\..+•, function\(\) { *$ | |
When the user clicks on a paragraph, original or added, anywhere in the document, slide it up out of view. | $("body").on("click", "p", function() { $(this).slideUp(); }); | ^ *\$\(•body•\)\.on\(•click•, •p•, function\(\) {\n *\$\(this\)\.slideUp\(\);\n}\); *$ | |
http://jsfiddle.net/ASmarterWayToLearn/zwnhmoLx/ | |||
http://jsfiddle.net/ASmarterWayToLearn/dy9w5e91/ |