Debounce

Wait until input stops for a moment before acting, instead of reacting to every keystroke.

JavaScript

Example

let t;
input.addEventListener('input', () => {
  clearTimeout(t);
  t = setTimeout(search, 200);
});

Related

Updated 2026-11-26 DOM →