how to stop event bubbling in javascript

Total Post:3


 736  View(s)
Rate this:

how to stop event bubbling in javascript

  1. Re: how to stop event bubbling in javascript

    Event handling is the receipt of an event at some event handler from an event producer and subsequent processes. The processes involved in event handling include: Identifying where an event should be forwarded. Making the forward.

    Event bubbling is a type of event propagation where the event first triggers on the innermost target element and then successively triggers on the ancestors (parents) of the target element in the same nesting hierarchy till it reaches the outermost DOM element or document object (Provided the handler is initialized).

  1. Re: how to stop event bubbling in javascript

    All handlers on the path reached on window of the events. A bubbling event goes from the target element is correctly and straight. this happens start first from <HTML>. any of the handlers may to decide for process or stopped a bubbling events. 

    The method is shown below :


     another method handlers are move but bubbling will be stopped.

    code for stopping Bubbling:
    if (event.stopPropagation) {   
        } else {
            event.cancelBubble = true;

    or through on click events:

    <body onclick="alert('bubbling is not here')">
    <button onclick="event.stopPropagation()">Go</button> 

    I hope, It will be helpful for You.

    You can find more information by my recent post on Bubbling .


    Happy Coding :)

      Modified On Jun-08-2018 12:33:23 AM


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.