getting the some td row values with jquery using class not id
<p>How can I get the td values with jquery?
The while loops will generate a few with the same class name... </p>

<pre><code>&lt;table&gt;
   &lt;?php
   while(...){
   ?&gt;
   &lt;tr&gt;
      &lt;td class="datao"&gt;data 0&lt;/td&gt;
      &lt;input type="button" class="getValue" value="Delete" /&gt;
   &lt;/tr&gt;
   &lt;?php
   }
   ?&gt;
&lt;/table&gt;
</code></pre>

<p>Jquery's: </p>

<pre><code>$(".getValue").click(function(){ $.post("somescript.php", { value:$("data0").val()}, function(data){ alert(data); }); });
</code></pre>

<p>UPDATE:</p>

<p>Well, I'm generating a table with data that came's from a database.
After that I want to delete any row from the database so, I put a button attached to every data value () the problem here is to get the proper td value once I'm using the same class name on every button and td... after that I will use AJAX and delete the PROPER row of data from database with PHP. </p>

<p>UPDATE:</p>

<p>The generated code will look like this:</p>

<pre><code>&lt;table&gt;
       &lt;tr&gt;
          &lt;td class="datao"&gt;xzczxc&lt;/td&gt;
          &lt;input type="button" class="getValue" value="Delete" /&gt;
          &lt;td class="datao"&gt;gfh+pso&lt;/td&gt;
          &lt;input type="button" class="getValue" value="Delete" /&gt;
          &lt;td class="datao"&gt;sdhgfjgk&lt;/td&gt;
          &lt;input type="button" class="getValue" value="Delete" /&gt;
          &lt;td class="datao"&gt;asdghdas&lt;/td&gt;
          &lt;input type="button" class="getValue" value="Delete" /&gt;
          &lt;td class="datao"&gt;egfcn&lt;/td&gt;
          &lt;input type="button" class="getValue" value="Delete" /&gt;
          &lt;td class="datao"&gt;sdfds..k&lt;/td&gt;
          &lt;input type="button" class="getValue" value="Delete" /&gt;
          &lt;td class="datao"&gt;6ytytu&lt;/td&gt;
          &lt;input type="button" class="getValue" value="Delete" /&gt;
          &lt;td class="datao"&gt;tyghj0&lt;/td&gt;
          &lt;input type="button" class="getValue" value="Delete" /&gt;
          &lt;td class="datao"&gt;daghjgh0&lt;/td&gt;
          &lt;input type="button" class="getValue" value="Delete" /&gt;
          &lt;td class="datao"&gt;dagh0&lt;/td&gt;
          &lt;input type="button" class="getValue" value="Delete" /&gt;
          &lt;td class="datao"&gt;dada0&lt;/td&gt;
          &lt;input type="button" class="getValue" value="Delete" /&gt;
          &lt;td class="datao"&gt;dasa&lt;/td&gt;
          &lt;input type="button" class="getValue" value="Delete" /&gt;
       &lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>How to delete for example the fourth row?
Or the fifth?</p>

<p>I just want to get the td values when press the button and passe those values to the php script that all.</p>

<p>I want to pass some td values to ajax call when pressing the button "Delete"</p>

<pre><code>&lt;table&gt;
       &lt;tr&gt;
          &lt;td class="datao"&gt;first column&lt;/td&gt;
          &lt;td class="data1"&gt;first column&lt;/td&gt;
          &lt;td class="data2"&gt;first column&lt;/td&gt;
          &lt;td colspan="2"&gt;&lt;/td&gt;
       &lt;/tr&gt;
       &lt;tr&gt;
          &lt;td class="datao"&gt;jkhghj&lt;/td&gt;
          &lt;td class="data1"&gt;dsfg&lt;/td&gt;
          &lt;td class="data2"&gt;iouhfg&lt;/td&gt;
          &lt;input type="button" class="deleteRow" value="Delete" /&gt;
       &lt;/tr&gt;
       &lt;tr&gt;
          &lt;td class="datao"&gt;hgjdss&lt;/td&gt;
          &lt;td class="data1"&gt;oiuy&lt;/td&gt;
          &lt;td class="data2"&gt;qweasd&lt;/td&gt;
          &lt;input type="button" class="deleteRow" value="Delete" /&gt;
       &lt;/tr&gt;
       &lt;tr&gt;
          &lt;td class="datao"&gt;aweda&lt;/td&gt;
          &lt;td class="data1"&gt;asd&lt;/td&gt;
          &lt;td class="data2"&gt;asd&lt;/td&gt;
          &lt;input type="button" class="deleteRow" value="Delete" /&gt;
       &lt;/tr&gt;
       &lt;tr&gt;
          &lt;td class="datao"&gt;asdasvg&lt;/td&gt;
          &lt;td class="data1"&gt;esw&lt;/td&gt;
          &lt;td class="data2"&gt;ee&lt;/td&gt;
          &lt;input type="button" class="deleteRow" value="Delete" /&gt;
       &lt;/tr&gt;
       &lt;tr&gt;
          &lt;td class="datao"&gt;qw&lt;/td&gt;
          &lt;td class="data1"&gt;zdg&lt;/td&gt;
          &lt;td class="data2"&gt;lykj&lt;/td&gt;
          &lt;input type="button" class="deleteRow" value="Delete" /&gt;
       &lt;/tr&gt;
&lt;/table&gt;
</code></pre>
