JSFiddle - React, Tailwind, and code Playground
HTML
<div id="search">
Hello!
</div>
JavaScript
jQuery.fn.delay = function(time,func){
return this.each(function(){
setTimeout(func,time);
});
};
$('#search').delay(2000, function(){
$('#search').fadeOut('fast');
}
);