Exercise:
Use the HTML DOM to hide the <p> element.
Hint
Hint:
element
.style.visibility = "
value
"
Edit This Code:
See Result »
<!DOCTYPE html> <html> <body> <p id="demo">Hello World!</p> <script> // Add code here </script> </body> </html>
Result:
Show Answer
Correct Code:
<!DOCTYPE html> <html> <body> <p id="demo">Hello World!</p> <script> document.getElementById("demo").style.visibility = "hidden"; </script> </body> </html>
Correct Result:
Hide Answer
Privacy Policy