index.html 1003 B

1234567891011121314151617181920212223
  1. <!DOCTYPE html>
  2. <!--
  3. TAG NOTES:
  4. <!DOCTYPE> is an abreviation for document type and describes what is this document. In this case it is a HTML document.
  5. <html> is the root of an html document. This is what the browser is looking for when reading.
  6. <body> It containes all HTML elements.
  7. <h1>, <h2>, <h3>, <h4> are tags which make headers in the HTML document
  8. <p> is a tag for making a paragraph with text. The more <p> tags you add you will see an enter between your last paragraph and new one.
  9. <button> is a tag for creating buttons in html. Buttons like a lot of other tags in html can be accessed by javascript
  10. -->
  11. <html>
  12. <body>
  13. <h2>Changing HTML Content with javascript getElementById.innerHTML function</h2>
  14. <!-- Assigning a id to the paragraph -->
  15. <p id="demo">JavaScript can change HTML content.</p>
  16. <!-- Changing the paragraph with id "demo" to different stuff -->
  17. <button type="button" onclick='document.getElementById("demo").innerHTML="Hello JavaScript!"'>Click Me!</button>
  18. </body>
  19. </html>