I am not a Javascript expert but as far as I know:
stopPropagation
is used to make sure the event doesn't bubble up the chain. eg. a click on a tag would also fire click events on it's parent , and then its parent , etc. stopPropagation prevents this from happening.
preventDefault is used to stop the normal action of an element, eg. preventDefault in a click handler on a link would stop the link being followed, or on a submit button would stop the form being submitted.
|