- What's the difference between event.stopPropagation and event.preventDefault?
- <div id="foo">
- <button id="but" />
- </div>
- $("#foo").click(function() {
- // mouse click on div
- });
- $("#but").click(function(ev) {
- // mouse click on button
- ev.stopPropagation();
- });