title: Jquery selector to find out count of non empty inputs
body: <p>I have the below HTML DOM </p>
  
  <pre><code>      &lt;div id="container&gt;
          &lt;p data-bind="visible:ShowPostCode()"&gt;
      &lt;label class="field-label" for="postcode"&gt;Postcode&lt;/label&gt;
      &lt;input id="txtPostCode" data-bind="value:PostCode, valueUpdate: &amp;quot;afterkeydown&amp;quot;" class="field-stretch" type="text"&gt;
      &lt;/p&gt;
  
       &lt;p data-bind="visible:ShowDateOfBirth()"&gt;
      &lt;label class="field-label" for="dateofbirth"&gt;Date of birth&lt;/label&gt;
      &lt;input data-bind="value:DateOfBirth, valueUpdate: &amp;quot;afterkeydown&amp;quot;" class="field-stretch" type="text"&gt;
      &lt;/p&gt;
  
               &lt;p style="display: none;" data-bind="visible:ShowtelephoneNumber()"&gt;
      &lt;label class="field-label" for="telephoneNumber"&gt;Telephone number&lt;/label&gt;
      &lt;input data-bind="value:DrivingLicenceNumber, valueUpdate: &amp;quot;afterkeydown&amp;quot;" class="field-stretch" type="text"&gt;
      &lt;/p&gt;
     &lt;/div&gt;
  </code></pre>
  
  <p>I would like to get the no of non-empty input boxes.</p>
  
  <p>This is what i tried</p>
  
  <pre><code>$('#container input[type="text"][value!=""]').length
  </code></pre>
  
  <p>or</p>
  
  <pre><code>$('#container input[type="text"]').filter('input[value!=""]').length
  </code></pre>
  
  <p>even when i input some values it is always showing as zero . what is wrong with these selectors i tried and why it is not working? </p>