jquery check value of input not empty 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('');