title: Javascript Basic Login Function
body: <p>can any1 explain it to me why this isnt working?
  Here's the script
  <div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script type= "text/javascript"&gt;
  function login() {
  var user = document.getElementById("username").value;
  var pass = document.getElementById("password").value;
  if(user == "lab18" &amp;&amp; pass == "lab18") {
      alert("Logged In");
      locate="new11.html"
      return false;
  } else {
      alert("wrong user/pass");
      return false;
      }
  }
  &lt;/script&gt;
     </code></pre>
  </div>
  </div>
  </p>
  
  <p>And here's the form:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form name="Form" onsubmit="login()"&gt;
      &lt;input type="submit" value="Log In" style = font-family:'Comic Sans Ms'&gt;</code></pre>
  </div>
  </div>
  </p>