Skip to content

JavaScript notes


Mozilla JavaScript Docs

W3 Schools JavaScript and HTML DOM Reference - The Vanilla JavaScript Repository

Mozilla: A re-introduction to JavaScript (JS tutorial)


CSS classList

var box = document.querySelector(".box");

Node versus Element

A node is the generic name for any type of object in the DOM hierarchy. A node could be one of the built-in DOM elements such as document or document.body, it could be an HTML tag specified in the HTML such as <input> or <p> or it could be a text node that is created by the system to hold a block of text inside another element. So, in a nutshell, a node is any DOM object.

An element is one specific type of node as there are many other types of nodes (text nodes, comment nodes, document nodes, etc...).