title: how to set minimum password of 8 characters in jQuery
body: <p>I am just trying to set a minimum password of 8 characters in a text box in jquery.  This is what I have so far but it just does not work:</p>
  
  <pre><code>    $(function() {
  var passwordLength = $('#password').val().length;
  
  
   if(passwordLength &lt; 8) {
       $('#password').next('.error').css('display', 'inline');
   } 
  
   }); 
  
   $('#password').change(function() {
   $(this).next('.error').css('display', 'none');
   });
  </code></pre>