change color of input if submit clicked and input is empty code example
Example: change color of input if submit clicked and input is empty
HTML :
Text <input type="text">
<button>Click Me</button>
--------------------------
JQuery :
$("button").on("click",function(){
if($("[type='text']").val() == null){
$(this).css("border","2px solid red");
}
});