JSFiddle - React, Tailwind, and code Playground

by Max Shu

HTML

<button onclick="myButtonClick()">meow</button>

JavaScript

var buttonTimer;

function myButtonClick() {
    if (!buttonTimer) {
        buttonTimer = setTimeout(function() {
            buttonTimer = null;
            // put your timer code here
            console.log('clicked')
        }, 2000);
    }
}