Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is the difference between event.stopPropagation and event.stopImmediatePropagation?



What is the difference between event.stopPropagation and event.stopImmediatePropagation?..

Answer / chaitanya

event.stopPropagation() allows other handlers on the same element to be executed, while event.stopImmediatePropagation() prevents every event from running. For example, see below jQuery code block.

Hide Copy Code

$("p").click(function(event){

event.stopImmediatePropagation();

});

$("p").click(function(event){

// This function won't be executed

$(this).css("background-color", "#f00");

});

If event.stopPropagation was used in previous example, then the next click event on p element which changes the css will fire, but in case event.stopImmediatePropagation(), the next p click event will not fire.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More jQuery Interview Questions

How can we add change font size using jquery?

0 Answers  


How can we apply css in last child of parent using jquery library?

0 Answers  


What is event.PreventDefault?

1 Answers  


How JavaScript and jQuery are different?

1 Answers  


How to get the server response from an ajax request using jquery?

0 Answers  


What is the latest version of jquery?

0 Answers  


Whether we need to add jQuery file in both Master and Content page?

0 Answers  


Explain the difference between onload() and document.ready() function used in jquery?

0 Answers  


List the advantages of jquery?

0 Answers  


What is the use of jquery .each() function?

1 Answers  


How do I check if an element is hidden in jQuery?

0 Answers  


Mention the advantages of cdn? : jQuery Mobile

0 Answers  


Categories