Posted By

dkl3in on 09/29/10


Tagged

js


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

bobbym245


Alternative for "return false;"


 / Published in: jQuery
 

Alternative for "return false;" stopPropagation(); prevents for bubbling up the dom preventDefault(); prevents the browser from performing the default action

  1. function() {
  2. return false;
  3. }
  4.  
  5. // is equal to
  6.  
  7. function(e) {
  8. e.preventDefault();
  9. e.stopPropagation();
  10. }

Report this snippet  

You need to login to post a comment.