<!DOCTYPE html> <html> <body> <h1 id="myH"></h1> <p id="myP"></p> <script> /* The code below will change the heading with id = "myH" and the paragraph with id = "myP" */ document.getElementById("myH").innerHTML = "JavaScript Comments"; document.getElementById("myP").innerHTML = "My first paragraph."; </script> </body> </html>
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter