---
title: "Discussion on \"How Events Move Through the DOM: Exploring Event Bubbling and Capturing\" | Hashnode"
description: "Discussion on \"How Events Move Through the DOM: Exploring Event Bubbling and Capturing\". Lets take an example,\nWe create a div and set up an onclick event that shows an alert with the message \"div handler\". Inside the div, there is a button labeled \"Click Me\".\nhttps://codepen.io/kyhtvzke-the-styleful/pen/PwojjRJ\n \nWhen you click the butt..."
url: "https://hashnode.com/posts/how-events-move-through-the-dom-exploring-event-bubbling-and-capturing/67ca8e7dee8fed8f901c5a7c"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How Events Move Through the DOM: Exploring Event Bubbling and Capturing](https://blogs-himanshu.hashnode.dev/how-events-move-through-the-dom-exploring-event-bubbling-and-capturing?utm_source=hashnode&utm_medium=feed)

Lets take an example, We create a div and set up an onclick event that shows an alert with the message "div handler". Inside the div, there is a button labeled "Click Me". https://codepen.io/kyhtvzke-the-styleful/pen/PwojjRJ When you click the butt...

Mar 7, 2025 · 5 min read · blogs-himanshu.hashnode.dev  
Read the article

-   [#chaicode](https://hashnode.com/tag/chaicode)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#web-development](https://hashnode.com/tag/web-development)
-   [#event-capturing-and-event-bubbling-in-javascript](https://hashnode.com/tag/event-capturing-and-event-bubbling-in-javascript)

## Written by

[himanshu](https://hashnode.com/@Himanshu-)

@Himanshu-

  
[View profile](https://hashnode.com/@Himanshu-)

Aspiring Web developer

Learning and learning

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
