title: How can i use input fields as parameters to functions in javascript?
body: <p>So I have some input text fields and a button</p>
  
  <pre><code>&lt;input type=text value="a"/&gt;
  &lt;input type=text value="b"/&gt;
  &lt;input type=button onclick=???/&gt;
  </code></pre>
  
  <p>and I want to use the values of those text fields as the parameters in a function that gets called when i click a button, say</p>
  
  <pre><code>function foo(a,b) {
      dostuff(a);
      dostuff(b);
  }
  </code></pre>
  
  <p>I don't know what to put in the question marks. So what gets the value of the text inputs, I don't think document.getElementById gets the value of them, just the element itself.</p>