JSFiddle - React, Tailwind, and code Playground

by Nirav Mehta

HTML

<input id="date" type="text" text="02/03/1985" value="02/03/1985" />

JavaScript

function call()
{    
if ($("#date").val().search((/^\d{2}\/\d{2}\/\d{4}$/))>-1) {
  $("#date").css('background-color', '#FF0000'); 
}
else {
  alert("good");
}
}
call();