Posted By

fael on 09/09/07


Tagged

event window stopPropagation preventDefault


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

fael


Stop default action


 / Published in: JavaScript
 

Really stop default action of a element.

  1. function stop(e) {
  2. if (!e) e = window.event;
  3. (e.stopPropagation) ? e.stopPropagation() : e.cancelBubble = true;
  4. (e.preventDefault) ? e.preventDefault() : e.returnValue = false;
  5. return false;
  6. }

Report this snippet  

You need to login to post a comment.