title: Javascript get values of multiple text fields
body: <p>I have a dynamic web page where the content may contain between 1 and 10 links, provided in text boxes, similar to the following:</p>
  
  <pre><code>&lt;input size="50" id="link" value="http://Something.Something" type="text"&gt;
  &lt;input size="50" id="link" value="http://SomethingElse.Something" type="text"&gt;
  </code></pre>
  
  <p>I need javascript to be able to read all of the links, and be able to manipulate the data (store in array, output to screen, etc)</p>
  
  <p>I know that I can read a single id using the following</p>
  
  <pre><code>var link = document.getElementById('link');
  </code></pre>
  
  <p>Which will return the first match - but, how can I do a loop or obtain all the values for all the links, bearing in mind that the number of links cannot be determined beforehand?</p>
  
  <p>P.S. I have tried using getElementsByTagName('input') but there are more inputs on the page, which means it's getting more results than I'd like it to get.</p>