title: Simple login form in JavaScript+HTML5 doesn't work
body: <p>I'm making a basic login page for my website (so people can access only the stuff they need to). The thing is, I've checked the code many times, and there seems to be no problem in it. Yet, the authentication doesn't work. The code:<br>
  HTML5:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;NSDCars5: Login&lt;/title&gt;
  &lt;script src="script123.js"&gt;&lt;/script&gt;
  &lt;link rel="stylesheet" type="text/css" href="style123.css" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div id="title"&gt;
  &lt;h1&gt;Hey, there! Ready for some client-side scripting?&lt;/h1&gt;
  &lt;h2&gt;So am I! Login here to continue.&lt;/h2&gt;
  &lt;h4&gt;Or if you're a hacker kind, I'm using JavaScript to validate the form.&lt;/h4&gt;
  &lt;/div&gt;
  &lt;div id="content"&gt;
  &lt;input type="text" id="username" /&gt;&amp;nbsp;
  &lt;input type="password" id="password" /&gt;&lt;br /&gt;
  &lt;button onclick="checkForPassw()"&gt;&lt;img src="icon.png" /&gt;&lt;/button&gt;&lt;br /&gt;
  &lt;/div&gt;
  &lt;div id="footer"&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>JavaScript:</p>
  
  <pre><code>function checkForUname() {
      var z = document.getElementById("password");
      if (z = "Gryffindor") {
          var z = "dxoincu3rhi"
          self.location = "\hiddencontent.html";
      } else {
          document.getElementById("result").innerHTML = "You think I'm that stupid!?";
      }
  }
  
  function checkForPassw() {
      var x = document.getElementById("username");
      if (x = "NSDCars5") {
          var x = "3d3huiun";
          checkForUname();
      } else {
          document.getElementById("result").innerHTML = "You think I'm that stupid!?";
      }
  }
  </code></pre>
  
  <p>What's the problem here?</p>