title: alert from input tag
body: <p>Hi all I have this script</p>
  
  <pre><code>&lt;form id="logform"&gt;
      &lt;input class="login" name="login" type="text"&gt;&lt;br /&gt;
      &lt;input class="password" name="password" type="password"&gt;&lt;br /&gt;
      &lt;input class="submit" type="submit" value="login"&gt;
  &lt;/form&gt;
  
  var username = $(".login").val();
  var password = $(".password").val();
  $(".submit").click(function() {
      alert(username);
  });
  </code></pre>
  
  <p>and when I type text in input and click submit alert is empty ?</p>