Work with legacy and simple sites using jQuery selectors, events, AJAX, effects, and plugins.
Lessons
Reveal and conceal elements with optional timing.
show(), hide() and toggle() is easiest to learn by reading the example, changing it, and observing the result.
$('#toggle').on('click', function () {
$('#panel').toggle(300, function () {
// runs after the animation finishes
const state = $(this).is(':visible') ? 'shown' : 'hidden';
$('#status').text('Panel is ' + state);
});
});Practice the show(), hide() and toggle() example in a small scratch file, then explain what changed and why.