JSFiddle - React, Tailwind, and code Playground

by NerfAnarchist

HTML

<body>
    <div id="there">Click here</div>
</body>

CSS

body {
    width: 100%;
    height: 100%;
}

#there {
    width: 100%;
    height: 100%;
    background-color:#EEEEEE;
}

JavaScript

// event that runs if the element hasen't been clicked on in a while
$(function () {
    var doit;
    
    $('#there').on('mousedown', function () {
        clearTimeout(doit);
        doit = setTimeout(function () {
            run_this();
        }, 500);
    });
});
function run_this(){
    $("body").append("<p>did it</p>");
}