title: Need to read the value of the selected Checkbox on Horizontal HTML Table
body: <p>I have a table with the horizontal header and wanted to achieve to get the values of the selected checkbox.
  Once the checkbox gets selected it should return me the values of that column for all the rows. Here is code.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;
  function myfunc(ele) {
  
   var values = new Array();
         $.each($("input[name='case[]']:checked").closest("tr").siblings("tr"),
                function () {
                     values.push($(this).text());
                });
      
         alert("val---" + values.join (", "));
   }
       
  
  $(document).ready(function() {
      $("input.case").click(myfunc);
  });
  &lt;/script&gt;
  &lt;table border="1"&gt;
  &lt;tr&gt;
    &lt;th&gt;Select&lt;/th&gt;
     &lt;td align="center"&gt;&lt;input type="checkbox" class="case" name="case[]" value="1"/&gt;&lt;/td&gt;
      &lt;td align="center"&gt;&lt;input type="checkbox" class="case" name="case[]" value="2"/&gt;&lt;/td&gt;
      &lt;td align="center"&gt;&lt;input type="checkbox" class="case" name="case[]" value="3"/&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
      &lt;th&gt;Cell phone&lt;/th&gt;
      &lt;td&gt;BlackBerry Bold 9650&lt;/td&gt;
      &lt;td&gt;Samsung Galaxy&lt;/td&gt;
      &lt;td&gt;Droid X&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;th&gt;Rating&lt;/th&gt;
         &lt;td&gt;2/5&lt;/td&gt;
         &lt;td&gt;3.5/5&lt;/td&gt;
         &lt;td&gt;4.5/5&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;th&gt;Location&lt;/th&gt;
        &lt;td&gt;UK&lt;/td&gt;
        &lt;td&gt;US&lt;/td&gt;
        &lt;td&gt;REB&lt;/td&gt;
      &lt;/tr&gt;
      &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>