title: Getting value from input box in html in external Javascript
body: <p>I have an HTML page and and external JavaScript file. 
  How do I access the value of an <code>input</code> tag from the HTML page in JavaScript? My HTML is as follows:</p>
  
  <pre><code>&lt;form name="formxml"&gt;
  &lt;input type="text" name="xmlname"/&gt;
  &lt;input type="submit" value="Click me please" onclick="loadxml()"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>In the Javascript file, I was trying:</p>
  
  <pre><code>var name = document.formxml.xmlname.value
  </code></pre>
  
  <p>but this gives an error of "document.formxml is undefined"</p>
  
  <p>What should I do?</p>