JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" id="clearTxt"/>      <input type="button" value="Search" id="button" />

JavaScript

$(function(){
    $("#button").click( function () {
        alert('button clicked');
        setTimeout(function(){
            alert('setTimeout');
            document.getElementById('clearTxt').value = "hi";
        }, 5000);
    });
});