I have a syntax error - I'm trying to add a class of 'error' if the input fields are blank. It's seems the error class is being applied even if the input fields have text, the logic looks correct to me. Can someone please assist?
$('input').each(function() {
if($(this).val() == "") {
$("input").addClass("error");
return false;
}
});