The Event Object
The handler receives an event with details such as target, pageX, key and which. stopPropagation stops bubbling and preventDefault stops the default action.
Example
$('a').on('click', function (e) {
e.preventDefault();
e.stopPropagation();
console.log(e.target);
});Exercise
Stop bubbling.
e.()
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.