I have a form that I would like all fields to be filled in. If a field is clicked into and then not filled out, I would like to display a red background.
Here is my
The :empty pseudo-selector is used to see if an element contains no childs, you should check the value :
:empty
$('#apply-form input').blur(function() { if(!this.value) { // zero-length string $(this).parents('p').addClass('warning'); } });