Work with legacy and simple sites using jQuery selectors, events, AJAX, effects, and plugins.
Lessons
Swap elements for new content.
replaceWith() and replaceAll() is easiest to learn by reading the example, changing it, and observing the result.
$('.done').remove(); // delete elements
$('#list').empty(); // clear children
const copy = $('#card').clone(true); // copy with handlers
$('#container').append(copy);
$('#old').replaceWith('<div id="new">Replaced</div>');Practice the replaceWith() and replaceAll() example in a small scratch file, then explain what changed and why.