title: I'm generating a basic form using JS; How can I get the data?
body: <p>I've got a basic javascript form creation script right here</p>
  
  <pre><code>var loginDiv;
  var loginForm;
  var formUserInput;
  var formUserPass;
  var formSubmit;
  
  loginDiv = document.createElement('div');
  loginDiv.id = 'loginDiv';
  
  loginForm = document.createElement("form");
  loginForm.setAttribute('method', "post");
  loginForm.setAttribute('action', 'JavaScript:doSomething()');
  
  formUserInput = document.createElement("input");
  formUserInput.setAttribute('type', "text");
  formUserInput.setAttribute('name', "username");
  
  formUserPass = document.createElement("input");
  formUserPass.setAttribute('type', "text");
  formUserPass.setAttribute('name', "password");
  
  formSubmit = document.createElement("input");
  formSubmit.setAttribute('type', "submit");
  formSubmit.value = "Submit";
  
  loginForm.appendChild(formUserInput);
  loginForm.appendChild(document.createElement("br"));
  loginForm.appendChild(formUserPass);
  loginForm.appendChild(document.createElement("br"));
  loginForm.appendChild(formSubmit);
  
  loginDiv.appendChild(loginForm);
  
  document.getElementById('game').appendChild(loginDiv);
  </code></pre>
  
  <p>my question is; How do I pass the values of the text-fields into the doSomething() function? </p>