JSFiddle - React, Tailwind, and code Playground

HTML

<div>Keep typing in the box below, pause every now and then</div>
<input id="goTOxQuestion">
<div id="loading" style="display: none;">Loading...</div>

CSS

body {
    font: 12px sans-serif;
}

JavaScript

$(function () {
    var hTimeout;
    $("#goTOxQuestion").keyup(function () {
        if (hTimeout) {
            clearTimeout(hTimeout);
        }
        hTimeout = setTimeout(function () {
            $("#loading").show();
            $.getJSON("/echo/json/", { delay: Math.floor(Math.random() * 5) }, function () {
                $("#loading").hide();
            });
        }, 500);
    });
});