HTML Editor
<!DOCTYPE html> <html lang="en-US"> <body> <p>P 1</p> <p>P 2</p> <p>P 3</p> <button onclick="myFunction()">Click Me</button> <script> function myFunction(){ var x = document.getElementsByTagName("p"); var txt = "Hello there!"; //Try to change '0' to '1' x[0].innerHTML = txt; } </script> </body> </html>
OUTPUT
×

Save as Private