views:

77

answers:

1

What is the selector syntax to select a tag after using the ":last" selector?

<table>
    <tr>
        <td>
            Cell 1
        </td>
        <td>
            <table>
                <tr>
                    <td>
                        The tag I want to get
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>

I'm using the following, to no avail:

$("table td:last table")
+2  A: 

try

$("table table td:last")
Darko Z
That worked. I also got table td:last:table to work. Is there a difference?
Jeremy
im not sure why table td:last:table would work, as there is no :table pseudo selector. If you meant table td:last then it will work because it finds 3 td of which the one you want is last. but it wouldnt work if you hade three td's in your base table.
Darko Z