Skip to content

Instantly share code, notes, and snippets.

@codeeshop-oc
Created February 9, 2022 12:07
Show Gist options
  • Save codeeshop-oc/5ef5e042e219225e24ee057622d01023 to your computer and use it in GitHub Desktop.
Save codeeshop-oc/5ef5e042e219225e24ee057622d01023 to your computer and use it in GitHub Desktop.
One-Off Event Handler Javascript
let func = (e) => {
alert('Function Run')
}
window.addEventListener('click', func, {once: true});
/*
More Details:
https://www.javascripttutorial.net/dom/events/create-a-one-off-event-handler/
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment