Work with legacy and simple sites using jQuery selectors, events, AJAX, effects, and plugins.
Lessons
Add, remove, and check CSS classes.
addClass & removeClass is easiest to learn by reading the example, changing it, and observing the result.
$('#tab').on('click', function () {
$('.tab').removeClass('active');
$(this).addClass('active');
});
$('#theme').on('click', function () {
$('body').toggleClass('dark');
});
console.log($('#box').hasClass('active'));Practice the addClass & removeClass example in a small scratch file, then explain what changed and why.