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
What is the keyword for getting text in a paragraph? | textContent | textContent | |
Fill in the blank to assign the text in the paragraph to the variable. | let txt = targeted paragraph__________________ | .textContent; | \.textContent; |
A targeted paragraph has been assigned to a variable, pgraph. Insert the string "Hi" into it. | pgraph.textContent = "Hi"; | pgraph\.textContent=•Hi•; | |
The targeted paragraph has been assigned to a variable. Assign the text in the paragraph to a variable that hasn't been declared beforehand. Make up the variable names. | let txt = pgraph.textContent; | let[a-z_$][a-zA-Z0-9_$]*=[a-z_$][a-zA-Z0-9_$]*\.textContent; | |
Insert a string into a span that has been assigned to the variable s1. Make up the string. | s1.textContent="California"; | s1\.textContent=•.*•; | |
If the text in p1 is "star", display an "ok" alert. | if (p1.textContent === "star") { alert("ok"); } |
if\(p1\.textContent===•star•\){[\r\n]alert\(•ok•\);[\r\n]} | |
What is the textContent of the following paragraph? | <yes<br>no> | yesno | yesno |
The page includes a single h1 heading. Insert a string into it using the querySelector key word. Make up the string. | document.querySelector("h1").textContent = "Big News"; | document\.querySelector\(•h1•\)\.textContent=•.*•; |
|
|