0
Display a variable value as a <p> element?
How can I display a variable value as a <p> element? All I need is the Javascript code. Iāve tried: var score = 0; document.getElementById(ātestā).innerHTML = score; var score = 0; document.getElementById(ātestā).value = score; āāā This is what the <p> tag inside of the <body> tags looks like: <p id=ātestā></p>
3 Answers
+ 2
It seems to be your parenthese.
Use the up and down ones found when coding.
Use these "" not these āā
https://code.sololearn.com/WICUzTAzoFb4/?ref=app
+ 1
The Cuber
<body>
...
<p id="test"><p>
...
</body>
var score = "12";
document.getElementById("test").innerHTML = score;
innerHTML expect the text (string) to assign with it
DHANANJAY PATEL
0
you can also use
${score}