check if form input empty jquery code example
Example 1: jquery check if input is empty on submit
var empty = true;
$('input[type="text"]').each(function() {
if ($(this).val() != "") {
empty = false;
return false;
}
});
Example 2: empty the value of an input in jquery
$('#field').val('');
Example 3: jquery select input with empty value
$('input:text').filter(function() { return $(this).val() == ""; });