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
"src" is an element's ______. | attribute | attribute | |
The method used to change or add an attribute is ___Attribute(). | set | set | |
The target element has been assigned to the variable targ. Fill in the blank to change its attribute. | ____________________("name", "mobile"); | targ.setAttribute | targ\.setAttribute |
The target element with an attribute of "src" has been assigned to the variable pic. Change the value of the attribute to "loris.png". | pic.setAttribute("src", "loris.png"); | pic\.setAttribute\(•src•,•loris\.png•\); | |
An anchor has been assigned to the variable lnk. Change its web address to "loris.html" | lnk.setAttribute("href", "loris.html"); | lnk\.setAttribute\.\(•href•,•loris\.html•\); | |
Target an element by id and assign it to a variable. Make up the id and the name of the variable. | let elementToChange = document.querySelector("#first-paragraph"); | let[a-z_$][a-zA-Z0-9_$]*=document\.querySelector\(•#.*•\); | |
A button has been assigned to the variable btn. Code an event listener that executes an arrow function. The arrow function displays an alert when the button is clicked. Make up the alert message. | btn.addEventListener("click", () => { alert("You clicked!"); }); | btn\.addEventListener\(•click•,\(\)=>{?alert\(•.*•\);}?\); | |
In a single statement, target the h1 heading and add a "name" attribute. Make up the value of the attribute. | document.querySelector("h1").setAttribute("name", "top-heading"); | document\.querySelector\(•h1•\)\.setAttribute\(•name•,•.*•\); | |
|
|||
|