Stop default action


/ Published in: JavaScript
Save to your folder(s)

Really stop default action of a element.


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.