title: Assign Array values to Table Cells (Js)
body: <p>I'm trying to give each td with the class '.m' a value from the array.</p>
  
  <p>i.e. the first cell is given first number from the array, the second cell is given the second number etc.</p>
  
  <p>The problem is that all of the cells are being given the same value of '1'</p>
  
  <p>Any help is much appreciated.</p>
  
  <p>Here is what I've tried so far:</p>
  
  <p>JsFiddle: <a href="https://jsfiddle.net/Fraser_M/8cs5tcav/2/" rel="nofollow">https://jsfiddle.net/Fraser_M/8cs5tcav/2/</a></p>
  
  <p>HTML: </p>
  
  <pre><code>&lt;table&gt;
   &lt;tr&gt;
    &lt;td class='m'&gt;&lt;/td&gt;
    &lt;td class='m'&gt;&lt;/td&gt;
    &lt;td class='m'&gt;&lt;/td&gt;
    &lt;td class='m'&gt;&lt;/td&gt;
    &lt;td class='m'&gt;&lt;/td&gt;
    &lt;td class='m'&gt;&lt;/td&gt;
   &lt;/tr&gt;
   &lt;tr&gt;
    &lt;td class='m'&gt;&lt;/td&gt;
    &lt;td class='m'&gt;&lt;/td&gt;
    &lt;td class='m'&gt;&lt;/td&gt;
    &lt;td class='m'&gt;&lt;/td&gt;
    &lt;td class='m'&gt;&lt;/td&gt;
    &lt;td class='m'&gt;&lt;/td&gt;
   &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>$(function() {
  
   var myArray = [1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1];
   var myArrayLength = myArray.length;
  
  
   for (var i = 0; i &lt; myArrayLength; i++) {
     $('.m').text(myArray[i]);
   }
  
  });
  </code></pre>