Count empty text fields in jQuery

Viewed 36

I've got this response in my Chrome console for a view:

$('.checklist-17012').length
5

There are five in the view, so that's correct. The problem is that they're all empty, and no matter what I do I can't count the empty ones:

$('.checklist-17012[val=""]').length
0

$('.pdf-checklist-17012[val=null]').length
0

Here's the HTML:

<input type="text" name="30954" id="30954" value="" class="checklist-17012 form-control">

What am I doing wrong?

1 Answers
Related