title: Assign value to html element using javascript
body: <p>Sorry if this is a simple question. </p>
  
  <p>I have this function getOrderNumber() that I want to create a unique order number using the javascript getTime(). I need then the function getOrderNumber to somehow assign a value to the html element. I tried a few iterations of what I have here which didn't work.</p>
  
  <p>Any help would be appreciated.</p>
  
  <pre><code>&lt;form action="https://www.someurl/saocctest.cgi" method="post"&gt;
  
  &lt;!--get unique order number--&gt;
  &lt;script&gt;
  function getOrderNumber() {
      var d = new Date();
      var n = d.getTime();
      form.elements("orderNumber").value=n;
  }
  &lt;/script&gt;
  
  &lt;input type="hidden" name="orderNumber"&gt;
  </code></pre>