Javascript examples for DOM:Element textContent
Element textContent Property - Change the textual content of a <p> element with id="myP":
<!DOCTYPE html> <html> <body> <p id="demo" onclick="myFunction()">Click me to change my textual content.</p> <script> function myFunction() {//from ww w.j a va2s.c o m document.getElementById("demo").textContent = "Paragraph changed!"; } </script> </body> </html>