
Explore the document object model as an in-memory representation of HTML or XML, and modify the DOM at runtime with JavaScript through its APIs, focusing on tree structures.
Learn to modify a web page with the document object model using JavaScript, inspect the elements panel, and change or overwrite the page title and content with window.document and document.write.
Learn to build the Dohm Adventure game project to practice the Document Object Model using plain JavaScript, manipulating HTML elements, canvases, sound effects, optimization techniques, and runtime DOM updates.
Understand how browsers interpret and expose the document object model through standards like the W3C dom, ensuring cross-browser compatibility and reliable APIs.
Clarify the browser object model (the BOM) and its role in interactivity, showing how the window object exposes browser features and provides access to the document object model.
Explore the cssom, the object model for css, a set of javascript APIs that manipulate css styles in the browser, showing how the document object model enables dynamic styling.
Explore the tree data structure, including nodes, roots, leaves, and edges, and understand how its hierarchy relates to the DOM tree.
Explore the DOM tree as a rooted, hierarchical map of HTML tags—head, body, p, span—where nodes have children, text properties, and attributes, and learn traversal and accessors.
Clarify that the DOM is not a programming language and explain how JavaScript uses DOM APIs to modify the document at runtime.
Build a dom-based game called Code Dome Adventure using traditional html elements and dom APIs, move a player, destroy walls with mines, and render splash, level, portal, and exit screens.
Learn to design and render an exit screen in a JavaScript DOM game by planning the flow, deciding when to destroy or render elements, and avoiding premature abstractions.
Create a new project folder with a separate source directory, then organize files by modules: app, game, and splash screen, for maintainable code.
Implement a splash screen by defining a class with render and destroy methods, wiring it in the index file and testing the render function to validate plumbing.
Extract assets into an organized assets folder, drag and drop splash screens, sounds, and game assets into your project, then organize code by creating an app namespace for maintainability.
Render the splash screen image at runtime by creating and inserting DOM elements with pure JavaScript, wiring the assets folder, and setting the document background without frameworks.
Learn to create DOM elements at runtime using document.createElement and append them to the document, while exploring the document API and MDN guidance for available methods.
Explore the document object model as a node tree and use append to add text and elements to the body, then styling, moving, or deleting nodes.
Create and append elements to the document body using append and appendChild, distinguishing between text and element nodes, and observe how adding to the end affects the document.
Create a splash element assigned to a typed variable and append it to document.body. Running the head script before the body renders triggers errors, so move the script after rendering.
Discover how to specify and modify classes on DOM elements using classList, add and remove classes, and compare classList to arrays while exploring className and element creation.
Apply static styles to a splash screen by using a splash screen class with a background image from assets and dimensions set to 650 by 650 pixels.
Master dynamic styling by injecting a style tag at runtime from JavaScript, keeping styles modular with a splash screen class and moving generation to a separate file.
Learn to create a root element and mount your app, then query the document to locate that root and append content, ensuring predictable, top-down rendering of the DOM.
Explore the browser's pixel pipeline and its five steps—JavaScript evaluation, style calculations, layout, paint, and composite—to understand rendering and measure performance with timeline steps.
Identify bad DOM update practices that degrade performance by simulating 100,000 reads and writes and updating classes, highlighting the impact on rendering and resource optimization.
Analyze runtime performance with the profiler to identify long tasks caused by rendering many DOM elements, then batch updates and reduce reads and writes to improve performance.
Batch DOM updates efficiently by using a document fragment to accumulate elements in memory, reducing reflows and reads while updating the root in a single paint.
Use the profiler to compare rendering and scripting performance under realistic conditions, identify bottlenecks like rendering 100000 nodes, and apply lazy rendering as you scroll to optimize the DOM.
Keep a root and private splash element reference, reuse it to avoid repeated DOM queries, then destroy and remove the splash node to improve performance.
Define runtime classes for two frames, tinker with background-position and no-repeat to animate a sprite, and switch the frames to build your first CSS-driven animation.
Master controlling splash screen animation by adding and removing classes, implementing a private animate method, and switching between splash screen one and two using timed intervals.
Toggle frames by updating a frame variable and applying classes, use string interpolation for dynamic class names, and run the animation on a one-second interval that resets after two frames.
Improve a JavaScript animation by using a max frame constant, resetting frames, and clearer naming; implement cleanup on destroy with clearInterval and define a frame rate constant for clarity.
Build the level for the game by rendering blocks and enabling the player's interaction with walls, while the level governs movement and transitions to the exit via the portal.
Define a state-driven data model to control the DOM for a game level. Represent the level as a two-dimensional grid of columns and cells with outer walls and destroyable walls.
Define a shared constants module to model level item types, represent empty content, and build a self-documenting, human-readable game level using a dimensional array and simple move checks.
Define a level class modeling a 13 by 13 grid with a 650-pixel width, a private columns array, and render and destroy methods, prepping for random items and outer walls.
Build a 13-slot array for a level grid, with zero-based indexes and non-iterable empty slots. Use the array constructor and fill to create distinct objects and model item types.
Map through the columns to build and fill each column’s cells with level objects. Refactor a messy one-liner into clearer code, instantiate the level, and render the result.
Refactor object literals into a level item class, import constants, and create self documenting methods to map 13 by 13 cells and render the outer walls.
Create the level element, assign the level and game classes, append the road route to the document, and maintain in memory references for future destruction while ensuring consistent initialization.
Learn to style the game level with a bundled CSS or SAS workflow, defining a level class with width, height, and a background from assets.
Bundle the application using the Parcel bundler to avoid manual loading and global namespace issues, configure npm or yarn for package management, lock exact versions, and prepare scripts for development.
Bundle your app by using the start script in the project root, point it to the index entry point, and run the server to see the benefits of bundling.
Learn to start a development server using npm start or yarn start, run the bundling process, and navigate the project structure while addressing scope changes that remove global level references.
Adopt ES modules by explicitly importing needed pieces, exporting where appropriate, and bootstrapping the app from an entry point, using DOMContentLoaded to render after the document loads.
Learn to manage css as esm imports in a JavaScript project, including automatic package installation, version pinning, asset path fixes, and debugging bundler errors through imports and reload.
Design the shape of our game level state by filling column data and placing outer wall flags at boundaries, guiding how the level renders in the document.
Initialize the walls by iterating columns, setting first and last columns to level eight outer wall types, others empty, using state as the source of truth to render DOM elements.
Learn to drive the DOM from state by rendering columns and cells, creating elements, and applying outer wall classes in a maintainable, in-memory workflow.
Learn how updates to state reflect in the dom by driving rendering of the outer walls, with first and last rows updating dynamically as width and height change.
Model and render chip walls in a grid by using the remainder operator to identify even column and cell indices, manage state, and apply a Hardwell class with assets.
The Document Object Model (DOM) is the data representation of the objects that comprise the structure and content of a document on the web. This is what we use when we work with Javascript and interact in any way dynamically with the document.
If you use Angular, Vue, React, or any other library or framework to create modern web applications, the DOM is what these use under the hood.
If you want to stand out as a JavaScript developer, you need to learn DOM fundamentals.
By the end of watching this course, you'll be able to:
Understand what is the DOM and how to interact dynamically with an HTML document.
Use modern and easy Javascript with classes, private attributes, and dom API's to build user interfaces.
Learn optimization techniques.
Apply easy bundling techniques that include dynamic CSS loading.
Search for documentation, you don't need to memorize all the DOM interfaces.
Interact with the DOM and user input through event listeners.
Apply clean code and best practices as we build along with our course project.
With this course, you'll get a downloadable source code package.
PREREQUISITES
Javascript concepts and basic fluency, functions, variables, running scripts.
This is a beginner and intermediate course.
You don't need previous experience with the DOM.
---
Promo video music license:
Adventures by A Himitsu - Creative Commons — Attribution 3.0 Unported— CC BY 3.0 Music released by Argofox - Music provided by Audio Library