title: How to pass a user entered form value from html to javascript?
body: <p>It is possible to pass a value from javascript to html by writing it to a  tag. However, if I would wish to pass a user defined value (etc, entered by the person viewing the webpage) to java script so I can do things with it, what would be the most easiest way possible?</p>
  
  <p>At the moment, I have something like this:</p>
  
  <pre><code> &lt;div class="entry foreground-color"&gt;
       &lt;form&gt;
           &lt;input type="text" name="commands" size="60"/&gt;
       &lt;/form&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>How can I make the value from the form be passed to my javascript?</p>
  
  <p>Or, am I going in a totally wrong direction? If so, what would be the correct way to get user input, and pass it on to javascript?</p>
  
  <p>EDIT: Apologies for my misuse of terminology. I am making a text based adventure game, and I want the user to be able to type in a response, press enter, and have the response be sent to javascript, so I can use javascript to evaluate the response (etc "go south", "go north"), and write back to the  element with the new situation (etc "as you went south, you found a troll").</p>