# The Page and the DOM

Learn the HTML and CSS a JavaScript developer needs (no other course required), then meet the DOM: the page as the browser holds it. Find elements, change their text and classes, and add and remove elements while the page is open.

Updated: November 15, 2026

## [The HTML and CSS JavaScript Needs](https://www.ask-codey.com/courses/javascript-in-depth/topics/javascript-page-basics)

1. [The HTML You Need for JavaScript](https://www.ask-codey.com/lessons/javascript-page-basics-the-html-you-need) (Novice): Read a web page the way JavaScript sees it, as elements with tags, attributes and content nested inside each other, with an id or a class on the ones your code needs to find.
2. [The CSS You Need for JavaScript](https://www.ask-codey.com/lessons/javascript-page-basics-the-css-you-need) (Novice): Read a CSS rule's selector, properties and values, pick elements by tag name, class, id or what they're inside, and see how a class added or removed by JavaScript changes the way an element looks.

## [The DOM in JavaScript](https://www.ask-codey.com/courses/javascript-in-depth/topics/javascript-the-dom)

1. [Introducing the DOM: an overview](https://www.ask-codey.com/lessons/introducing-the-dom-an-overview) (Novice): When the browser loads a page, it turns the HTML into the DOM, a tree of objects with one for each element, and JavaScript reads and changes the page through that tree.
2. [Locating DOM elements](https://www.ask-codey.com/lessons/introducing-the-dom-locating-dom-elements) (Apprentice): Most searches start at the document, the whole page, where getElementById finds an element by its id, querySelector finds the first match for a CSS selector, and querySelectorAll finds every match.

## [Changing the Page](https://www.ask-codey.com/courses/javascript-in-depth/topics/javascript-changing-the-page)

1. [Common DOM Interactions](https://www.ask-codey.com/lessons/working-with-elements-common-dom-interactions) (Apprentice): Once you have an element, you change its text with textContent, its HTML with innerHTML, its look with style, and its CSS classes with classList.
2. [Manipulating the DOM Structure](https://www.ask-codey.com/lessons/working-with-elements-manipulating-the-dom-structure) (Apprentice): createElement makes a new element, appendChild puts it inside a parent so it shows on the page, and remove takes an element off the page.

## [Exercise: Band Fan Page](https://www.ask-codey.com/courses/javascript-in-depth/topics/exercise-javascript-band-fan-page)

1. [Exercise: Band Fan Page](https://www.ask-codey.com/lessons/exercise-javascript-band-fan-page) (Apprentice): Put a band's tour on its fan page with JavaScript, building a line for each upcoming show from an array, marking the sold-out ones and counting what's left, with tests for the data and a checklist for the page.

Source: https://www.ask-codey.com/courses/javascript-in-depth/chapters/the-page-and-the-dom-in-javascript
