jQuery : Get row by tr 'id'
jquery
Solution
Well, you should usually avoid having numeric-only id's (unless you are using 100% HTML5!). And you should definately make sure id's are unique on your page.
But you should be able to use jquery selector
$('#1')
Assuming you're not using HTML5, then you should change your markup to use a more standard ID:
<tbody role="alert" aria-live="polite" aria-relevant="all">
<tr id="row1" class="odd">
<td class=" sorting_1">bla</td>
</tr>
<tr id="row3" class="even">
<td class=" sorting_1">hej</td>
</tr>
...
Then you would access a particular row using
$('#row1')
Problem
Hey im trying to access a specific row. I have the id attr of the tr I wan't to get. My table looks like this: ``` <tbody role="alert" aria-live="polite" aria-relevant="all"> <tr id="1" class="odd"> <td class=" sorting_1">bla</td> </tr> <tr id="3" class="even"> <td class=" sorting_1">hej</td> </tr> <tr id="4" class="odd row_selected"> <td class=" sorting_1">sdf</td> </tr> <tr id="8" class="even"> <td class=" sorting_1">testgfdgvcxbvcbcv</td> </tr> <tr id="9" class="odd"> <td class=" sorting_1">testgfdgvcxbvcbcvfdgsgfdgdfs</td> </tr> </tbody> ``` Here i need to access But I can't figure out how to access this.