stopPropagation
stops the event from bubbling up the event chain.preventDefault
prevents the default action the browser makes on that event.
Let's say you have
<div id="foo">
<button id="but" />
</div>
$("#foo").click(function() {
// mouse click on div
});
$("#but").click(function(ev) {
// mouse click on button
ev.stopPropagation();
});