title: why does my form password validation not work
body: <p>good day people. 
  I am trying to create a password validation before form submission using javascript and jquery
  When the submit button is clicked I want it to validate password.
  If password is not set, it will alert that password has not been entered. otherwise display success message and submit form. </p>
  
  <p>Here is my javascript:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
  
  &lt;head&gt;
  
    &lt;script type="text/javascript" src="https://jinji.jinjer.biz/assets/templates/hr/js/jquery.min.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;form method="post" id="login-form" target="dummyframe" action="https://kintai.jinjer.biz/v1/sign_in"&gt;
  
  
      &lt;input name="company_code" type="hidden" value="5709" /&gt;
  
      &lt;input name="email" type="hidden" value="5685" /&gt;
  
      &lt;input class="jpassword" name="password" type="password" /&gt;
      &lt;input value="LogIn" class="submit" /&gt;&lt;br&gt;&lt;br&gt;
  
    &lt;/form&gt;
  
    &lt;script&gt;
      $(document).ready(function() {
        $(function() {
          $(".submit").on('click', function() {
            var password = document.getElementByClassName("jpassword");
            if (password.val = "") {
              alert("Please Enter password");
              else {
                alert("Success. Now you can login");
                document.getElementById("login-form").submit();
              }
            }
  
          });
  
        });
      });
    &lt;/script&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>My code doesnt work. Am i missing something?
  You help would be greatly appreciated.</p>
  
  <p>
  </p>