SyntaxFix
Write A Post
Hire A Developer
Questions
in modern browsers you can do the following...
button.addEventListener( 'click', () => { alert( 'only once!' ); }, { once: true } );
https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Parameters