title: w3c document.forms[0].fieldname equivalent
body: <p>I've been using </p>
  
  <pre><code>document.forms[0].fieldname.value
  </code></pre>
  
  <p>to get values in javascript from a form, but I'd like to use a name to reference the field and not a 0, what would be the equivalent these days since <code>&lt;form name="formname"&gt;</code> isn't compliant?</p>