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?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you use multiple document.ready() function on the same page?

979


Tell me is jquery a library for client scripting or server scripting? : jquery mobile

804


Differentiate the concepts of .js and .min.js?

955


what does $("div") will select? : jquery mobile

877


What is jquery.length? : jquery mobile

890


How to divide a page into parts using jquery mobile? : jquery mobile

869


How do you select an item using css class or id and get the value by use of jquery.

848


Explain the advantages of jquery?

971


What is the use of jquery.data()?

890


How to submit a form without submit button using jquery?

858


What are selectors in jquery? : jQuery Mobile

922


Explain the difference between .js and .min.js?

868


Can you please explain the difference between prop and attr? : jquery mobile

782


How to add or remove classes to an element in jquery?

790


What is event.PreventDefault in jQuery?

898