Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <h1>The Element Object</h1> <h2>The textContent Property</h2> <p id="demo" onclick="myFunction()">Click me to change my textual content.</p> <script> function myFunction() { document.getElementById("demo").textContent = "I have changed!"; } </script> </body> </html>