JSFiddle - React, Tailwind, and code Playground

by TrueBlueAussie

HTML

<input type="textbox" class="abc">
<div class="showoff">Type to Change Me!</div>

JavaScript

$(document).ready(function(e) {
  var timer;
  $(".abc").keyup(function() {
  	var $input= $(this);
    // Start timer
    clearTimeout(timer);
    // Start a new 3 second timer
    timer = setTimeout(function() {
    	// Once the 
      var a = $input.val();
      $(".showoff").text("wait..");
      $.post('bbs.php', {
        a: a
      }, function(abc) {
        $(".showoff").html(abc);
      });
    }, 3000);
  });
});