JSFiddle - React, Tailwind, and code Playground

by eddiarnoldo

HTML

<button>Message</button>

JavaScript

var timeout = setTimeout(function(){
        alert("hello")
        },2000)


   clearTimeout(timeout);
 
$("button").click(function(){
     clearTimeout(timeout);
    timeout = setTimeout(function(){
        alert("hello")
        },2000)
                 })