How do I get the IDs of table rows in a array?
Example I want to have:
var rows = // IDs of rows
Here is my table code:
http://pastie.org/2675460
from paste bin:
<table cellspacing="0" cellpadding="0" id="admintabel" style="width:980px;">
<tbody><tr style="height: 40px; font-size: 14px; font-weight: bolder; font-family: Arial; cursor: move;">
<th style="border-left:1px solid #CCCCCC">Navn</th>
<th>Udbyder</th>
<th>Kliks</th>
<th>Pris md.</th>
<th>Mindstepris</th>
<th></th>
<th></th>
<th style="border-right:1px solid #CCCCCC"></th>
</tr>
<tr id="2" style="cursor: move;" class="">
<td style="border-left:1px solid #CCCCCC">Der</td>
<td>0</td>
<td>1</td>
<td> kr.</td>
<td> kr.</td>
<td><a class="viewlink" href="/bredbands/2"></a></td>
<td><a class="editlink" href="/bredbands/2/edit"></a></td>
<td style="border-right:1px solid #CCCCCC"><a rel="nofollow" data-method="delete" data-confirm="Are you sure?" class="deletelink" href="/bredbands/2"></a></td>
</tr><tr id="1" style="cursor: move;">
<td style="border-left:1px solid #CCCCCC">Te</td>
<td>0</td>
<td>0</td>
<td>147 kr.</td>
<td>148 kr.</td>
<td><a class="viewlink" href="/bredbands/1"></a></td>
<td><a class="editlink" href="/bredbands/1/edit"></a></td>
<td style="border-right:1px solid #CCCCCC"><a rel="nofollow" data-method="delete" data-confirm="Are you sure?" class="deletelink" href="/bredbands/1"></a></td>
</tr>
</tbody></table>
If using my table the array would be [2, 1]
I’d use
map()andget().jsFiddle.