Given the html of:
<input type="text" name="name1" value="">
I run console.log( $('input[value='']).length );
and get 1.
If I then enter a value in the field and run console.log( $('input[value='']).length );
again I still get 1. What gives? Do selectors only work on the original values of forms?
If I set the value from start, i.e.
<input type="text" name="name1" value="">
... I get the expected 0 when I run console.log( $('input[value='']).length );
There's a workaround for jquery < 1.8.3, (using input:text[value='']
instead), but >= 1.9, this doesn't work either.