Trying to grab ids from the table below when a row is selected. For example, the jquery should return: "12,14"..My code below returns empty string?
My html:
<table id="display" width="100%">
<thead>
<tr>
<th>ID</th>
<th>first</th>
<th>last</th>
<th>number</th>
</tr>
</thead>
<tbody>
...etc...
<tr class="selected">
<td>12</td>
<td>Bob</td>
<td>Smith</td>
<td>9999</td>
</tr>
<tr>
<td>13</td>
<td>Lee</td>
<td>Smith</td>
<td>8888</td>
</tr>
<tr class="selected">
<td>14</td>
<td>JJ</td>
<td>Wolf</td>
<td>77777</td>
</tr>
... etc..
</table>
My Jquery:
var nameIDs = $('table tr.selected td:first').map(function () {
return this.value;
}).get().join(',');