title: In jquery how to get the values of a particular row of a table that is selected using checkbox?
body: <p>This is my jsp:</p>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
      pageEncoding="ISO-8859-1"%&gt;
  &lt;!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"/&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;
  &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  &lt;table id="one" style="border:1px solid red;"&gt;
      &lt;caption&gt;Table 1&lt;/caption&gt;
  &lt;thead&gt;
  &lt;tr&gt;
  &lt;th&gt;&lt;/th&gt;
  &lt;th &gt;ID&lt;/th&gt;
  &lt;th&gt; Name&lt;/th&gt;
  &lt;th&gt;System&lt;/th&gt;
  &lt;/tr&gt;
  &lt;/thead&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td&gt;&lt;input type="checkbox" /&gt;&lt;/td&gt;
          &lt;td&gt;12&lt;/td&gt;
          &lt;td&gt;Sam&lt;/td&gt;
          &lt;td&gt;FSS&lt;/td&gt;
       &lt;/tr&gt;
  
       &lt;tr&gt;
          &lt;td&gt;&lt;input type="checkbox" /&gt;&lt;/td&gt;
          &lt;td&gt;87&lt;/td&gt;
          &lt;td&gt;Harry&lt;/td&gt;
          &lt;td&gt;MSS&lt;/td&gt;
       &lt;/tr&gt;
       &lt;tr&gt;
          &lt;td&gt;&lt;input type="checkbox" /&gt;&lt;/td&gt;
          &lt;td&gt;23&lt;/td&gt;
          &lt;td&gt;Rita&lt;/td&gt;
          &lt;td&gt;MVV&lt;/td&gt;
       &lt;/tr&gt;
       &lt;tr&gt;
          &lt;td&gt;&lt;input type="checkbox" /&gt;&lt;/td&gt;
          &lt;td&gt;65&lt;/td&gt;
          &lt;td&gt;Tom&lt;/td&gt;
          &lt;td&gt;RDD&lt;/td&gt;
       &lt;/tr&gt;   
     &lt;/tbody&gt;
  &lt;/table&gt;
  
  &lt;br&gt;&lt;hr&gt;&lt;br&gt;
  &lt;button id="add"&gt;Add&lt;/button&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here, when I click on add button I want to get all the values of the corresponding row that is checked in different variables namely id, name &amp; system that should contain the checked values.</p>
  
  <p>I want these values to be stored in a String (not map).
  Could you please suggest me a jquery / js to achieve the folllowing</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>If I have a hidden field along with the checkbox how can I get its value?
  For example</p>
  
  <pre><code>&lt;td&gt;
  &lt;input type="checkbox" /&gt;
  &lt;input type="hidden" value="secret" id="alertTyp" /&gt;
  &lt;/td&gt;
  </code></pre>