JSFiddle - React, Tailwind, and code Playground

HTML

<div class="test">
 Hello!
</div>

JavaScript

function hide(el) {
  	el.style.visibility = 'hidden';    
    return el;
}

function show(el) {
    el.style.visibility = 'visible';    
    return el;
}

// let t = $('.test')[0];     // you can use jQuery to get element
let t = document.querySelector(".test");
setTimeout(() => { hide(t) }, 1000)
setTimeout(() => { show(t) }, 2000)