How do I check if two input fields have values using JQuery? : <p>I would like to execute a block of code if two input fields have values. Here's the code that I have so far but I believe I typed the syntax wrong.</p>

<pre><code>jQuery(document).ready( function($) {

 $('button').click(function(){

  if ($('#signonname').length &gt; 0) &amp;&amp; ($('#signonpassword').length &gt; 0) {

    // do something

    } else {

          alert('Fields are not filled out');

          }

    });

});    
</code></pre>
