I am trying to use jquery to change the border color of an element when it is not empty. From what I've looked up everything seems right, but I still can't seem to get it to work.
Here is my JS fiddle: https://jsfiddle.net/jessica_mather123/ez3tgnvc/1/
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");
}
});