JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" id="username" />

JavaScript

$(document).ready(function() {
	var timer = '';
  $('input#username').keypress(function() {
    var _this = $(this); // copy of this object for further usage
    clearTimeout(timer);
    timer = setTimeout(function() {
			alert(_this.val());
    }, 3000);
  });
});