javascript idiom: stopPropagation+preventDefault vs. cancelBubble+returnValue

if (event.stopPropagation) event.stopPropagation( ); // DOM Level 2
else event.cancelBubble = true; //IE

// prevent default action

if (event.preventDefault) event.preventDefault( ); // DOM Level 2
else event.returnValue = false; // IE
About these ads

0 Responses to “javascript idiom: stopPropagation+preventDefault vs. cancelBubble+returnValue”



  1. Leave a Comment

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s





Follow

Get every new post delivered to your Inbox.

%d bloggers like this: