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"); } });