SyntaxFix
Write A Post
Hire A Developer
Questions
const button = document.getElementById(btnId); button.addEventListener("click", function() { // Submit form }, {once : true}); // Disabling works too, but this is a more standard approach for general one-time events
Documentation, CanIUse