jQuery Clicking Div Within Div

August 30, 2012 — Leave a comment

I want a click event on a div, and it will fire anywhere in the div except for the button inside it.

$(".div").click(function() {
    // Click event for the div, I'm slide toggling something
    alert("clicked div");

$(".button").click(function(e) {
    // Do stuff for the button click, but don't fire event above
    alert("clicked button");

source: Event Order


Posts Twitter Facebook

My name is Michael Le, and I am a web developer.

No Comments

Be the first to start the conversation.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.