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
The querySelector method uses standard ____ selectors. | CSS | CSS | |
The statement targets the element with an id of "p1". Fill in the blank. | let firstParagraph = document.querySelector_____; | ("#p1") | \(•#p1•\) |
The statement targets the h1 heading. Fill in the blank. | let bigHeading = _________________("h1"); | document.querySelector | document\.querySelector |
The statement targets an element with an id of "mainDiv". Fill in the blank. | let main = ______________________________; | document.querySelector("#mainDiv") | document\.querySelector\(•#mainDiv•\) |
Assign the element with a particular id to a variable. Make up the id and the variable name. | let whatever = document.querySelector("#address-field"); | let[a-z_$][a-zA-Z0-9_$]*=document\.querySelector\(•#.*•\); | |
A button has been assigned to the variable btn. Using an arrow function, display an alert when the button is clicked. Make up the alert message. | btn.addEventListener("click", () => { alert("hi"); }); |
btn\.addEventListener\(•click•,\(\)=>{[\r\n]?alert\(•.*•\);[\r\n]?}\); | |
When the h1 heading is clicked, the variable headingClicked is assigned true. Fill in the blank. | _______________________.addEventListener("click", () => { headingClicked = true; }); |
document.querySelector("h1") | document\.querySelector\(•h1•\) |
When the element with an id of "heading-3" is moused over, use an arrow function to assign an integer to a variable that has already been declared. Make up the integer and the variable name. | document.querySelector("#heading-3").addEventListener("mouseover", () => { x = 0; }); |
document\.querySelector\(•#heading-3•\)\.addEventListener\(•mouseover•,\(\)=>{[\r\n]?[a-z_$][a-zA-Z0-9_$]*=(0|-?[1-9][\d]*);[\r\n]?}\); | |
|
|||
|