I am trying to add a click event on a div thats inside a li that already has a click event. I don't want the li click event to fire when the div click event is fired.
Here is the jsfiddle of what I am trying to do. http://jsfiddle.net/2srUd/5/
When I click on the .inside I don't want the #outside click to fire. I assume I need to ad a not to the selector $(".inside")
<script>
$(document).ready(function() {
$("#outside").click(function() {
alert("outside click");
});
$(".inside").click(function() {
alert("inside click");
});
});
</script>
<ul>
<li id="outside" style="border:2px solid red; padding:20px;">
<div class="inside" style="border:2px solid blue; ">Click This Div. I want to accept the inside click but not the outside click.</div>
</li>
</ul>