Work with legacy and simple sites using jQuery selectors, events, AJAX, effects, and plugins.
Lessons
Stop default actions and event bubbling deliberately.
preventDefault & stopPropagation is easiest to learn by reading the example, changing it, and observing the result.
$('#myForm').on('submit', function (event) {
event.preventDefault(); // stop the page reload
console.log('Handling submit in JavaScript');
});
$('.child').on('click', function (event) {
event.stopPropagation(); // stop bubbling to parents
});Practice the preventDefault & stopPropagation example in a small scratch file, then explain what changed and why.