Javascript examples for DOM HTML Element:Paragraph
Update and change <p> element text in button action
<html> <head></head> <body> <p id="p1">Hello</p> <br> <button onclick="ChangeText()">Button</button> <script> var p1 = document.getElementById("p1"); function ChangeText () { p1.innerHTML = "Changed text on button click!"; }// www . j a va 2 s . c o m </script> </body> </html>