JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" id="comment" /><input type="text" />
<input type="submit" value="send" />

JavaScript

var _commentBlurTimer = 0;
$("#comment").blur(function() {
    var oInput = $(this);
   _commentBlurTimer = window.setTimeout(function() {
      oInput.val("blurred!");
   }, 500);
});


$("input[type=submit]").click(function() {
   if (_commentBlurTimer)
      window.clearTimeout(_commentBlurTimer);
});