Using jquery, how can I find the first div that contains an input with no value?
<div class="field">
<input type="text" value="12">
</div>
<div class="field">
<input type="text" value="13">
</div>
<div class="field">
<input type="text">
</div>
<div class="field">
<input type="text">
</div>
$('.field input').filter('text[value=""]').parent().addClass('first_empty')
You were so close. Add the element to the attribute selector, or
':text[value=""]'will work as well. DEMO