Work with legacy and simple sites using jQuery selectors, events, AJAX, effects, and plugins.
Lessons
React to keydown, keyup, and keypress input.
Keyboard Events is easiest to learn by reading the example, changing it, and observing the result.
$('#search').on('keyup', function (event) {
const value = $(this).val();
$('#count').text(value.length + ' characters');
if (event.key === 'Enter') {
console.log('Search for:', value);
}
});Practice the Keyboard Events example in a small scratch file, then explain what changed and why.