Created
February 9, 2022 12:07
-
-
Save codeeshop-oc/5ef5e042e219225e24ee057622d01023 to your computer and use it in GitHub Desktop.
One-Off Event Handler Javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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