title: creating and submitting a form with javascript
body: <p>I'm trying to create a form and submit it immediately with javascript and I cannot figure out what I'm doing wrong. here is my code:</p>
  
  <pre><code>function autoLogIn(un, pw) {
  var form = document.createElement("form");
  document.body.appendChild(form);
  form.method = "POST";
  form.action = "login.php";
  var element1 = document.createElement("&lt;INPUT NAME='un' TYPE='hidden' VALUE='"+un+"'&gt;");  
   form.appendChild(element1);
  var element2 = document.createElement("&lt;INPUT NAME='pw' TYPE='hidden' VALUE='"+pw+"'&gt;"); 
  form.appendChild(element2);
  form.submit();
  }
  </code></pre>