What is the correct JavaScript syntax to change the content of the HTML element below? <p id="demo">This is a demonstration.</p | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the correct JavaScript syntax to change the content of the HTML element below? <p id="demo">This is a demonstration.</p

2nd Sep 2021, 3:59 AM
Pro Dot
Pro Dot - avatar
3 Answers
+ 2
demo.innerHTML ="Your New content"
2nd Sep 2021, 4:11 AM
Pariket Thakur
Pariket Thakur - avatar
+ 3
document.getElementById('demo').innerHTML = "I am changed content";
2nd Sep 2021, 5:05 AM
Rupali Haldiya
Rupali Haldiya - avatar
0
Hi Pro Dot ,Please don't put tags like this sword in your question description Happy Coding!
2nd Sep 2021, 4:33 AM
<★Shaurya Chauhan★>(ACTIVE AGAIN✌😇🙃)
<★Shaurya Chauhan★>(ACTIVE AGAIN✌😇🙃) - avatar