1
2
3
4
5
6
7
8
9
10
To practice on your own, or to check code you believe shouldn't have been scored as incorrect, go to CodePen.
0,1,2,3,4,5,6,7,8,9
0
0
0
0
This event listener calls the function when the user clicks anywhere on the document. | document.addEventListener(______, greetUser); | "click" | •click• |
Type the two incorrect characters in this statement. | document.addEventListener("click", greetUser()); | () | \(\) |
When the user clicks anywhere on the document, this function is triggered. Code the event listener. | function youClicked() { alert("You clicked"); } |
document.addEventListener("click", youClicked); | document\.addEventListener\(•click•,youClicked\); |
When the user clicks anywhere on the document, the function is called. Fill in the blank. | _________("click", greetUser); | document.addEventListener | document\.addEventListener |
Code an event listener that calls the function addNumbers() when the user clicks anywhere on the document. | document.addEventListener("click", addNumbers); | document\.addEventListener\(•click•,addNumbers\); | |
Code an event listener that calls a function when the user clicks anywhere on the document. Make up the function name. | document.addEventListener("click", someFunction); | document\.addEventListener\(•click•,.*\); | |
When an event listener is listening for a double click, the first argument inside the parentheses is "dblclick". Code an event listener that listens for a double click anywhere on the document. Make up the function name. | document.addEventListener("dblclick", someFunction); | document\.addEventListener\(•dblclick•,.*\); | |
Using an arrow function, code an event listener that displays "Hi" in an alert when the user clicks anywhere on the document. | document.addEventListener("click", () => { alert("Hi"); }); |
document\.addEventListener\(•click•,\(\)=>{[\r\n]?alert\(•Hi•\);[\r\n]?}\); | |
|
|||
|