How To Prevent Default Event Behavior Using jQuery
erics, May 23rd, 2011
1 2 3 4 |
jQuery("a").click(function(event) { event.preventDefault(); ...your code here... }); |
Quote from original post: “e.preventDefault() will prevent the default event from occuring, e.stopPropagation() will prevent the event from bubbling up and return false will do both. Note that this behaviour differs from normal (non-jQuery) event handlers, in which, notably, return false does not stop the event from bubbling up.” Original Post: http://stackoverflow.com/questions/1357118/javascript-event-preventdefault-vs-return-false Other Event […]