Modify ↓
Ticket #5441 (closed bug: invalid)
Selectors of multi-table
| Reported by: | kyany | Owned by: | john |
|---|---|---|---|
| Priority: | major | Milestone: | 1.4 |
| Component: | selector | Version: | 1.3.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
<table id="1">
<tr id="11"><td>
<table id="1-1"><tr><td>First Row</td></tr>
</td></tr> <tr id="12"><td>
<table id="1-2"><tr><td>Middle Row</td></tr>
</td></tr> <tr id="13"><td>
<table id="1-3"><tr><td>Last Row</td></tr>
</td></tr>
</table>
$("#1 tr:last").html(); I want to get html text of id 13.but the result is tr's text of table 1-3
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

The selector is working just like it should, it got you the last tr of all the descendant tr elements. The last one happened to be in a nested table. Something like $("#1>tbody>tr:last") might be more what you wanted, but that would be best discussed in the forums and not the bug tracker.
Also, id attributes cannot start with a digit so this markup isn't valid.