Skip to content

Instantly share code, notes, and snippets.

@jatinkumar725
Created February 5, 2023 13:03
Show Gist options
  • Save jatinkumar725/8cf48f943d759479f57f14870fbfc03a to your computer and use it in GitHub Desktop.
Save jatinkumar725/8cf48f943d759479f57f14870fbfc03a to your computer and use it in GitHub Desktop.
Solution: Event Handler
const input = document.getElementById("myInput");
let timeoutId;
input.addEventListener("input", function() {
clearTimeout(timeoutId);
timeoutId = setTimeout(() => {
console.log("input changed");
}, 500);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment