HTML:
<button id="button">Click me!</button>
JavaScript:
$("#button").click(function() {
console.log("clicked");
})
I can't use
setTimeout
because the function will start a second late, which I don't want to happen. It'll also still run twice if the button was clicked twice within a second.Is there a way to do this?