Bug Tracker

Opened 13 years ago

Closed 13 years ago

#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:
Blocked by: Blocking:

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 (1)

comment:1 Changed 13 years ago by dmethvin

Resolution: invalid
Status: newclosed

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.

Note: See TracTickets for help on using tickets.