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
Complete the statement to create a <p> element. | let pgraph = ________________; | document.createElement("p"); | document\.createElement\(•p•\); |
Complete the statement to create a text node, "Hello World!" | let txt = _______________; | document.createTextNode("Hello World!") | document\.createTextNode\(•HelloWorld!•\) |
Complete the statement to create a blank comment node. | let blnkCommment = _____________; | document.createComment("") | document\.createComment\(••\) |
Create a list item. Assign it to a variable, newLI. | let newLI = document.createElement("li"); | letnewLI=document\.createElement\(•li•\); | |
Create a new <h2>. Assign it to a variable that hasn't been declared beforehand. Make up the name of the variable. | let newHeading = document.createElement("h2"); | let[a-z_$][a-zA-Z0-9_$]*=document\.createElement\(•h2•\); | |
Create a comment. Make up its content. Assign it to a variable that hasn't been declared beforehand. Make up the name of the variable. | let newComment = document.createComment("Duh!"); | let[a-z_$][a-zA-Z0-9_$]*=document\.createComment\(•.*•\); | |
Create a text node. Assign it to a variable that hasn't been declared beforehand. Make up the name of the variable. Make up the text content. | let textNode = document.createTextNode("Etc."); | let[a-z_$][a-zA-Z0-9_$]*=document\.createTextNode\(•.*\.•\); | |
Create an image element. Assign it a source (a jpg). Make up everything. | let newImg = document.createElement("img"); newImg.setAttribute("src", "images/loris.jpg"); |
let([a-z_$][a-zA-Z0-9_$]*)=document\.createElement\(•img•\);[\r\n]\1\.setAttribute\(•src•,•.*.jpg•\); | |
|
|||
|