JSFiddle - React, Tailwind, and code Playground
HTML
<input id="test1" type="text" class="dateRangeEducLev">
<input id="test2" type="text" class="dateRangeEducLev">
<input id="test3" type="text" class="dateRangeEducLev">
CSS
.active{
background-color : red;
}
JavaScript
$(".dateRangeEducLev").on("focusin",function(){
$(this).addClass("active");
alert("focusin");
$(this).unbind( "focusin" );
});
$(document).on("focusout",".active",function(){
$(this).removeClass("active");
$(this).bind( "click", function( ) {
$(this).on("focusin",function(){
$(this).addClass("active");
alert("focusin");
$(this).unbind( "focusin" );
});
});
});