title: Update multiple table rows in javascript
body: <p>Im currently quite new to javascript and im just trying to learn some basic things. Im not so bad in other languages so i do understand concepts etc.</p>
  
  <p>I have a table with 10 rows for example, One of the cells is a "CaseID" and it exists for every row. Im trying to use the Math.Random property to generate random numbers.</p>
  
  <p>My problem i hit first was i was using the ID property in my HTML and obviously this is unique, next i used class. I tried to append the output with an index but this again only worked for the first cell and nothing for the rest.</p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;td class="caseID"&gt;&lt;/td&gt;
  </code></pre>
  
  <p><strong>JS:</strong></p>
  
  <pre><code>var caseID = Math.floor((Math.random() * 10000));
  document.getElementsByClassName("caseID")[0].innerHTML = caseID;
  </code></pre>
  
  <p>This all works great for the first cell/row but every other row returns blank. Im assuming because i need to perhaps create an array/indexing but im unsure on how to do this. </p>
  
  <p>Could i create a variable:</p>
  
  <pre><code>var tds = document.getelementsbyclassname("caseID");
  </code></pre>
  
  <p>And maybe write a foreach etc? again not sure on how to do this.</p>
  
  <p>Thanks in advance!</p>