title: Hiding a div when textboxes are empty - backbone, javascript
body: <p>I want to show/hide a div depending on the lenght of text boxes. I am using a backbone structure, so not sure where to place the code.. </p>
  
  <p>but here is my code;</p>
  
  <pre><code>&lt;input type="text" id="txtUsername" placeholder="username"&gt;&lt;br&gt; &lt;input
  type="text" id="txtPassword" placeholder="password"&gt;
  
  &lt;div id="results"&gt;
    // text here
  &lt;/div&gt;
  </code></pre>
  
  <p>js</p>
  
  <pre><code>$('#chooseScan').addClass('hide');
          if ($('txtUsername').length &gt; 0 &amp;&amp; $('txtPassword').length &gt; 0) {
              $('#results').removeClass('hide');
              $('#results').addClass('show');
          }
  </code></pre>