Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Document Object Model (DOM) - Complete Guide - Part 2 (2026)
Highest Rated
Rating: 4.9 out of 5(588 ratings)
3,776 students

Document Object Model (DOM) - Complete Guide - Part 2 (2026)

Advanced Document Object Model (DOM) course for everyone! Learn about events | bubbling | hierarchy | nodes | PROJECT
Created byClyde Matthew
Last updated 1/2026
English

What you'll learn

  • Become a Document Object Model (DOM) EXPERT
  • Understand Capturing vs Event Bubbling
  • Learn the DOM object hierarchy
  • Understand the differences between host objects vs native objects
  • Learn what DOM extensions are
  • Understand what event delegation is
  • Learn how to listen and react to different DOM events
  • Listen for different events (like click events, input events, focus events, and more!!!)
  • Practical - build a project with me in real time
  • Become a pro at listening for events that are fired
  • What a callback function is
  • The different types of events (such as keyup, mousemove, touch, etc.)
  • JavaScript objects vs DOM objects
  • Master the skill of listening for events at various stages (capturing or bubbling)
  • How to stop events from traversing up or down the DOM
  • From beginner to expert (advanced +)
  • You will emerge an expert
  • Gives you depth of knowledge to boost your ability and confidence

Course content

8 sections137 lectures9h 45m total length
  • Introduction - what is a DOM event?3:07

    DOM Events are used to notify us (developers) of interesting things that have taken place.

    Each event is represented by an object which is based on the Event interface, and may have additional custom fields and/or functions used to get additional information about what happened. Events can represent everything from basic user interactions to automated notifications of things happening in the rendering model.

    It is a massive topic, and thats why this first section is quite lengthy. We are going to look at a lot of events in this course, and will constantly look at examples of how we can apply what we've learnt to real web applications.

    I truly hope you enjoy this section.

    See you in the lecture!

  • Before we begin ... take a step back0:42

    Sometimes we stand so close the wall, we can't see the painting.

    This is a quick look at Events, and how it relates to JavaScript.

  • The 2 most important things when it comes to events4:20

    The interaction of JavaScript with HTML is handled through events. We know this.

    And, events are actions that occur when either the user or the browser itself manipulates the page. We also know this.

    But what you may not have known is that each event requires 2 things to properly function - an event listener and an event handler.

    This lectures discussed these two very important things.

  • What is the difference between an Event Listener and Event Handler1:06

    A lot of my students get confused about the difference between listeners and handlers - which is exactly the reason for this short and sweet article.

    Enjoy!

  • Inline Event Listeners - brief introduction5:58

    As a web developer. you may be wondering why you need to learn about old-school approaches such as the inline event listener.

    Well, my philosophy is that you need to understand the old, in order to understand the new. Yes, there are limitation to this of course - none of us want to learn web development techniques that are out-dated and redundant. But, you will commonly see inline event listeners in your career, so this becomes really important for you to understand. It also sets the base for the new addEventListener() method which we will be getting into shortly.

  • Do we need to wrap our attribute values in quotation marks?1:08

    Sometimes you'll see me omit the quotation marks when writing an inline event listener. In the previous example you saw this when I wrote the boom() function without quotation marks.

    This can confuse a lot of people, including developers.

    But let me explain to you why this is valid HTML code.

  • Why is it important to learn about inline event listeners?0:55

    You may be thinking that because the inline event listener is old-school, that you don't have to bother learning about it.

    But you would be wrong.

    Read this article to find out why.

  • Inline Properties - brief introduction5:07

    Adding event listeners to the DOM via an inline property is yet another method we need to look at.

    It is very similar to inline event listeners.

    Under both approaches, we're adding an event listener as an attribute to the actual DOM element we're attaching it to. The major difference is that here, we're using JavaScript to do so. The major benefit with this is that our HTML source code can be kept super clean and clean.

  • addEventListener() method - brief introduction4:24

    Now we're talking honey!

    This is the newest method available to us, and is what we'll be using for most of this course.

    Its major benefits over the previous 2 approaches are: 

    1. it attaches an event listener and handler to an element without overwriting existing event handlers; and

    2. you can add numerous event handlers to one element; and

    3. you can add many event listeners of the same type to one element, i.e you can have two "click" events.

  • Summary - the 3 ways to add an event listener to HTML elements1:00

    Take a step back, and lets recap on what we've just learnt - the 3 ways we can add event listeners to an element.

  • 3 ways to add an event listener0:11

    As we've seen, there are different ways we can add an event listener to the DOM.

    But, pictures are worth a thousand words, so here is an infographic that summarizes these methods.

  • A quick word on events2:05

    I don't want you to lose sight of why we are learning about events. This is just a quick break and chat about where we've come from, and why web developers need to understand events in order to master front-end web development.

  • Are event listeners heavy on performance?1:09

    Have you thought about how an event listener actually works? Does it sit there and constantly check if an event has been fired? Although this may seem to be the most intuitive process, its not how listeners actually work.

    This brief article discusses, at a very high level, how an event listener works.

    I hope you find it really interesting.

  • Inline Event Listeners - detailed overview4:19

    We've seen the high level description of an inline event listener, but now its time to get dirty and dig into this in a bit more detail.

    To become an awesome programmer, you need to understand things in detail.

    I hope you're enjoying this course so far and learning a ton.

    Keep motivated.

  • Inline Event Listeners - TEST introduction (part 1 of 3)2:03

    Its test time!

    We're now going to see a practical example of coding a website.

    Yes, its going to be very simple. We are only going to have 2 buttons. And each button will change the text color on our page.

    Although this is a simple example, bear in mind we're only getting started. By the end of this section we're going to cover a few more advanced examples - you'll emerge an expert programmer.

  • Inline Event Listeners - TEST setup (part 2 of 3)4:05

    Lets write our code together and set up our test file.

    If you really don't feel like coding alongside with me, then you can just download this task-code.html file and start there.

    Enjoy!

  • Inline Event Listeners - TEST solution (part 3 of 3)9:18

    We now want to finish off this exercise, by making our buttons work.

    Remember what it is we're doing.

    We have our buttons. We have our paragraph tags.

    Now all we have to do is add an inline event listener to our buttons. We need to 'listen' for a 'click' event. When this click event is fired, then we need to change the color of our heading and paragraph tags.

    Make sense? 

  • Inline Properties - detailed overview2:31

    Using inline properties to attach event listeners to the Document Object Model is very similar to using inline event listeners.

    But in this instance, we use JavaScript to attach the listener to the element.

    Importantly, under both approaches, we're attaching the event listener as a property (or attribute) the element.

  • Inline event listeners are not recommended0:21

    Inline event listeners are easy to insert into your code, but they are not the best way.

  • HTML attributes vs DOM properties1:36

    There is a difference between DOM properties and HTML attributes. This short article explains why.

  • Inline Properties - TEST introduction (part 1 of 3)1:48

    This is quite a fun test, because we are going to dynamically display content when you click a button.

    But we also use CSS animation to make the transition less harsh.

  • Inline Properties - TEST setup (part 2 of 3)7:09

    As always, I love writing code with you. I highly encourage you to follow along.

    But if you are really advanced and don't want to code alongside me, then feel free to download the set-up code attached to this lecture.

  • Inline Properties - TEST solution (part 3 of 3)11:18

    Its solution time ;)

    We have to attach an inline property listener to our <a> element. We do this by using JavaScript.

    The last part is now to change the styling of the entire <div> element thats wraps all of our content. We do this because at the moment we've given this wrapper a max-height property. This max-height property needs to expand when the <a> tag is pressed.

    Don't worry if you're still not 100% sure how its done.

    Lets go through it together in this lecture.

  • Event handling the better way0:29

    Why is the addEventListener so much better than inline event listeners? 

  • addEventListener() method - detailed overview4:36

    So far, we've been attaching event listeners inline and using object properties. But these types of handlers and listeners are not great - they do not keep our code clean, and you can only attach one handler at a time.

    To get around this, the more modern approach is to use the addEventListener() method.

  • Callback functions - a quick overview5:19

    As we have just seen, the event handler function is a callback function.

    But what exactly does this mean? 

    This lecture will tell you.

  • Callback function - don't get intimidated1:18

    A "callback" is any function that is called by another function which takes the first function as a parameter. A lot of the time, a "callback" is a function that is called when something happens. That something can be called an "event" in programmer-speak.

  • addEventListener - TEST introduction (part 1 of 3)1:59

    This is another fun test.

    This time, we want to allow the user to click on a circle, and randomly change its color.

    These tests are very important for you to attempt. It will dramatically improve your web development skills.

    Enjoy!

  • Circle Challenge - what I want you to do

    To be clear, this is what I want you to do. Good luck.

  • addEventListener - TEST setup (part 2 of 3)7:37

    As a full stack website developer, you need to be able to code front end as well as back end applications.

    Thats why I always like coding the entire exercise from scratch, and encourage you to do the same.

    But if you really don't want to, then I have attached the code to this lecture, so you can pick up from here.

  • addEventListener - TEST solution (part 3 of 3)11:35

    Did you give the test a go? I hope so.

    Where do we begin? 

    The best approach at solving a problem is to break it up into little steps.

    We know that we want to trigger a change of color when the user clicks the circle. So, the first step is to grab the circle element in the DOM. We can put this circle in a variable.

    We then use JavaScript to attach a click event listener to this circle.

    We use the addEventListener() method to do so.

    We can then define our handler function to handle the code that executes when the click event is fired.

    And this is where the tricky part of our code lives.

    Remember, we're using hexadecimal format to define the color on our circle. We know that we have access to over 16m different colors, so we need a way to randomly generate a hex value.

    Don't worry, there are a few bonus lectures below that go into detail about how digits, bytes and hexadecimals work.

  • Can you pass arguments into the addEventListener() callback function?1:44

    It can be a little confusing if you want to pass in arguments to the callback function when using the addEventListener method.

    Let me explain the problem and how you can solve it.

  • Improving our code0:59

    For a CSS hex number to work, you need to have 6 digits.

  • EXTRA lecture - 3 ways to define a color4:10

    Every color on the web can be represented in many different ways.

    For example, we can type the word "blue", but we can also write blue as #0000ff, #00f, rgb(0,0,255) and many other ways. It doesn't matter which one you choose as long as it's a valid color.

    Importantly, you can apply any of these ways to define a color to a website or blog. It comes down to personal preference.

    A little bit of FYI, did you know: 

    • to set a background color, use background-color.

    • to set the text color, use color

    • to set a border color, use border-color.

  • EXTRA lecture - digits, bytes and hexadecimal format8:15

    A bit is a binary digit, the smallest increment of data on a computer. It represents only 2 values - either a 0 or 1 that correspond to the electrical values of off or on, respectively.

    Because bits are so small, you rarely work with information one bit at a time.

    Bits are usually assembled into a group of eight to form a byte. A byte contains enough information to store a single ASCII character, like "h".

    We've seen that each hexadecimal color (Red, Blue or Green) is represented by a byte.

    Confused? 

    Don't panic, lets jump into it now.

  • Digits, bytes and hexadecimal recap0:52

    As a developer, it can get quite complex and confusing ... thats why I always like taking a step back in strategic locations. This is one of those strategic locations.

    Remember what we've done.

    We had to generate random values in order to produce random colors for our circle.

    In our Math function, we produced a random value between 0 and 16,777,215.

    All we're trying to do is understand where this number comes from.

    These are bonus lectures and definitely not required in order for you to master the Document Object Model.

  • EXTRA lecture - toString() method2:23

    We're almost finish learning about events within the DOM.

    The last part of our custom function was taking our randomly generated value, and converting it to hex format using JavaScript's toString() method.

    Importantly, every object has a toString() method that is automatically called when you require the object to be represented as a text value or when an object is referred to in a manner in which a string is expected.

  • What I didn't mention2:16

    We ran pretty quickly through the toString() method.

    But let me stop and explain it in a little more detail.

  • Events

Requirements

  • Desire to become a full stack web developer using native JavaScript
  • Basic HTML, CSS and JavaScript will be helpful, but not absolutely necessary
  • A Mac or PC is required as you need to code alongside me to learn effectively

Description

*** BEST ADVANCED DOM COURSE ON UDEMY ***

  • Master Event Handling: Understand capturing vs. event bubbling to control how events flow through the DOM.

  • DOM Hierarchy: Learn about parent, sibling, and child relationships to manipulate elements effectively.

  • Differentiate Objects: Grasp the differences between host objects and native objects for better coding practices.

  • DOM Extensions: Discover how to enhance the functionality of your web applications.

  • Event Delegation: Optimize your event handling with this powerful technique.

  • BUILD A PROJECT: we build a project together to enhance your knowledge

What This Course Covers

This advanced Document Object Model (DOM) course empowers you to take control through understanding. Crafting an interactive web experience can be challenging, but together we will explore the intricacies of DOM events.

I'll help you answer questions like What exactly are events? Why are they essential? What types of events can we listen for, and how does event bubbling and capturing work? By answering these questions and more, you’ll gain the skills to access and manipulate the DOM effectively, allowing you to create dynamic applications that enhance user engagement and experience.

This course is the second and final installment of a comprehensive 2-part program. While Course 1 lays the groundwork for coding dynamic sites, this Part 2 dives deeper into the world of DOM events. You’ll emerge with a solid understanding and practical experience in handling events within the DOM, setting you on the path to becoming a true Grandmaster in front-end web development.

Why You Need This Course

If you've ever wondered how to add animation and life to your web pages, understanding DOM events is crucial.

The DOM allows users to interact seamlessly with your application—enabling them to ADD, EDIT, DELETE, or UPDATE content without frustration. We’ll start by defining what an event is, distinguishing between event listeners and event handlers, and then explore various ways to implement events in your code.

We won’t stop there!

We’ll delve into advanced topics like event propagation (capturing vs. bubbling) and the powerful concept of event delegation. This course also covers essential subjects like DOM extensions and object hierarchy.

Knowledge is Power

By the end of this course, you'll be able to "speak" and "navigate" the DOM confidently, understanding how to manipulate it in meaningful ways. Each lecture digs deeper into essential topics, with bonus lectures that extend your knowledge base and challenge your skills.

Through hands-on examples, this course helps you grasp the DOM piece by piece while utilizing the latest JavaScript features (like the new classList API) so you can stay ahead of the curve.

*** An advanced Web Development DOM course on Udemy ***

Successful programmers know more than rote learning a few lines of code. They also know the fundamentals of how events work on your website behind the scenes. If you’re wanting to become a full stack developer, you need to know how to work with various events in the DOM. You need to know what an event is, how to listen for it, and more importantly, how to react to events when they happen.

I want you to become a successful front-end programming Grandmaster.

I want you to be able to apply what your learn in this course to your webpage.

This course is perfect for you.

A unique view

Understanding the DOM is a vast topic. To get you up to speed, I’ve spent months thinking about where to focus content and how to deliver it to you in the best possible way.

You will learn "why" things work and not just "how". Understanding advanced topics within the DOM (like event types, capturing, bubbling, delegation, host vs native objects, etc.) is important as it will give you infinite possibilities. Armed with this knowledge, you’ll be able to create applications that update the data of the page without needing a refresh. You will be able to create apps that are customizable by the user. You can even allow the user to drag, move, and delete elements. Can you begin to see how important the DOM is?

How is this course different?

There are lots of great courses that focus on web development. Pity they never get into the detail about how the Document Object Model (DOM) works behind the scenes – a skill that every full-stack developer needs to master.

In this Part 2 course, I focus on the more advanced topics of true web development in the front end. This includes understanding what events are, looking at object hierarchy, understanding the different event types, what capturing and bubbling is, and how you can use the concept of event bubbling to streamline your code and make your job of creating dynamic websites easier.

Practice makes perfect

Theory is theory … but there’s nothing like getting behind your computer and typing in code. That’s why we will be coding, laughing and pulling out our hair together as we code real life websites and exercises during this course in order to appreciate and master the DOM.

I love practical examples, which is why we build simple pages and analyze the DOM together.

This course is FULL of practical examples, challenges, and we even build an entire project website from start-to-finish (yep, this includes building the HTML and CSS together too).

Is This Course Right for You?

Absolutely! This course is suitable for all levels of web developers. If you identify with any of these categories, this course is perfect for you:

  • You want to explore programming fundamentals and how JavaScript can enhance your web pages.

  • You’re eager to learn how successful developers create engaging user experiences.

  • You seek a solid understanding of advanced front-end concepts.

  • You want to understand JavaScript on the front end before diving into backend frameworks like Node.js.

  • You have a basic grasp of the Document Object Model (DOM) but want to learn how events work at a more advanced level.

Why Start Now?

Web development is a hot topic right now! Your competitors are already enhancing their skills—don't get left behind. This course offers memorable learning experiences, actionable tactics, and real-world examples that will set you apart.

What You Get

  • Lifetime access to all tutorial videos—no hidden fees or subscriptions.

  • Q&A support for any questions you may have.

  • Quizzes and challenges to reinforce your learning.

Let’s embark on this exciting journey together toward becoming a professional web developer! I can't wait to see you in the lectures!

Let's get crackin'

Who this course is for:

  • A great course if you have some basic knowledge about what the DOM is, but you want to dig deeper and understands DOM events in more detail
  • YES: This course is for beginners. Aimed at people new to the world of web development. However, having completed Part 1 of this 2-part series is highly recommended
  • NO: This course is NOT only for beginners. It is a complete beginner to advanced master course that is suitable for intermediates who know the basics and have an idea the DOM, but want to dig deeper to know its inner workings. Experienced students sometimes prefer to skip a section that they are very familiar with
  • YES: This course is for someone wanting to be a professional, to be expert and confident in the entire front-end web development process
  • Those who want to learn modern coding without third party libraries and frameworks
  • Those interested in building their own frameworks, or being better able to learn from the source code of other well-known frameworks and libraries
  • Those who have some knowledge of web development, but little knowledge about how it works behind the scenes, and how to practically implement best practices in their websites