JSFiddle - React, Tailwind, and code Playground

HTML

<body>

Enter your name: <input type="text">
    <div id="loading" style="display:inline;"></div>
  <img src="http://jimpunk.net/Loading/wp-content/uploads/loading3.gif" alt=""
    width="20px" style="position:relative;margin-top:5px;"/>

</body>

JavaScript

$(document).ready(function(){
  $("input").blur(function(){
      $('#loading').show();
      
    var imageSrc = "http://jimpunk.net/Loading/wp-content/uploads/loading3.gif";
    $('#loading').html("<img src='"+imageSrc+"' />");  
      
      setTimeout(function(){$('#loading').html("").hide();},5000);
      
  });
});