DEV Community

Jennifer Tieu
Jennifer Tieu

Posted on • Updated on

Self-Taught Developer Journal, Day 37: TOP DOM Manipulations and Events cont.

Today I learned...

Important Note

JavaScript does not alter your HTML, but the DOM. It changes what the browser renders.

DOM manipulation methods will not work if the JavaScript file is called before the DOM nodes are parsed and created. To fix this, you can:

  • include JavaScript at the bottom of your HTML file
  • link the JavaScript file in the head of your HTML document
  • use the script tag, set the src attribute to the path to the JS file, and include the defer keyword to load the file after the HTML is parsed


  1. a p with red text that says “Hey I’m red!”

JS Code

Web Page Output


The Odin Project

Top comments (0)