JSFiddle - React, Tailwind, and code Playground

HTML

<!--<div class="hide" style="background: yellow; width: 60px; height: 60px;"></div>-->
<input type="button" class="hide" style="background: yellow; width: 60px; height: 60px;" value="hide"></input>

JavaScript

var MenuToggle = document.getElementsByClassName("hide")[0];
MenuToggle.style["-webkit-user-select"] = "none";
MenuToggle.addEventListener("touchstart", Vanish);
MenuToggle.addEventListener("touchend", VanishClear);
var timer;
function Vanish() {
    longpress = false;
    timer = setTimeout(function() {
        MenuToggle.style.display = "none";
    }, 1000);
}
function VanishClear() {
    clearTimeout(timer);
}