Difference between e.preventDefault and e.preventPropagation ?

There big difference between them that `e.preventDefault` uses to prevent the default action of the browser for event like click but the parent DOM still be affected by the click event
`e.preventPropagation` prevent the event for the parent DOM also

For more information see the following links :

http://stackoverflow.com/a/5963688/868103
http://davidwalsh.name/javascript-events

Advertisements
Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

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

%d bloggers like this: