JSFiddle - React, Tailwind, and code Playground

by rajaadil

HTML

Keey any of text box empty and get focus out of it <br /> <br />
<input type="text" /> <br /><br />
<input type="text" /> <br />
<div id="error" style="display:none">Fill all the textboxes</div>

<input id="btnSubmit" type="button" value="Submit Button" />

JavaScript

$('#btnSubmit').click(function() { 
     $("#error").hide();    
     $('input:text').each(function(){
       if( $(this).val().length == 0)
          $("#error").show('slow');
    });
});