title: Loop through a table and get the value of each checked checkbox
body: <p>I have a problem right now. I'm trying to loop through my current table td and get each value of the checked checkboxes and concatenate all the checked values into a string, but I'm unable to accomplish it.</p>
  
  <p>This is what I have so far:</p>
  
  <p>HTML:</p>
  
  <pre><code>    &lt;table class="TestTable"&gt;
        &lt;tr&gt;
           &lt;td&gt;&lt;input type="checkbox" id="chkBox1" value="TestVal1"&gt;Test Val 1&lt;/td&gt;
           &lt;td&gt;&lt;input type="checkbox" id="chkBox2" value="TestVal2"&gt;Test val 2 &lt;/td&gt;
         &lt;/tr&gt;
         &lt;tr&gt;
            &lt;td&gt;&lt;input type="checkbox" id="chkBox3" value="TestVal3"&gt;Test val 3 
  &lt;/td&gt;
          &lt;/tr&gt;
          &lt;/table&gt;
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code>var TableVals = "";
      $('.TestTable').each(function(){
          TableVals += $('.TestTable').find('input[type="checkbox"]:checked').val();
          alert(TableVals);
      })
  </code></pre>
  
  <p>So if id chkBox1, chkBox2, chkBox3 was checked, I'm expecting:</p>
  
  <pre><code>Test Val 1, Test val 2, Test val 3 are checked
  </code></pre>
  
  <p>If only chkBox1, then</p>
  
  <pre><code> Test Val 1 is checked
  </code></pre>
  
  <p>JSFiddle attached here: <a href="https://jsfiddle.net/hegx4a0t/3/" rel="nofollow noreferrer">https://jsfiddle.net/hegx4a0t/3/</a> </p>