How do I associate an ID with a content of a div?
<p>For example I have a HTML table...</p>

<pre><code>name | grade  | action
bob  | 1.0    | [button class="button" id='1']
jack | 2.0    | [button class="button" id='2']
john | 3.0    | [button class="button" id='3']
</code></pre>

<p>When I click the button,</p>

<p>to get the id...</p>

<pre><code>$(function(){
$('.button').click(function()
var buttonid = this.id
});
});
</code></pre>

<p>so if I were to press buttonid 1 how do I get the name 'bob' without having to open the database?</p>

<p>Additionally if I press the button how do I get the values in each column? i.e. If I press button 3 how do I get grade 3.0 or get both name and grade?</p>

<p>Script that generates the row of the table</p>

<pre><code>while(){ 
echo '&lt;tr&gt;'; 
echo '&lt;td&gt;'.$name.'&lt;/td&gt;'; 
echo '&lt;td&gt;'.$grade.'&lt;/td&gt;'; 
echo '&lt;td&gt; &lt;input type="button" class="button" id="'.$id'"&lt;/td&gt;';
echo '&lt;/tr&gt;';
}
</code></pre>
