Jquery获取系列中最后一个元素的最后一行表

apt*_*tap 6 html javascript ajax jquery

我有一系列基于部分的幻灯片:

<div id="slides">
    <section id="first">
        <section>
            <table>
                <thead>
                </thead>
                <tbody>
                    <tr id="somethingUnique">
                    ...
                    </tr>
                </tbody>
            </table>
        </section>
        <section>
            <table>
                <thead>
                </thead>
                <tbody>
                    <tr id="somethingUnique">
                    ...
                    </tr>
                </tbody>
            </table>
        </section> 
       ...
    </section>
</div>
Run Code Online (Sandbox Code Playgroud)

我需要选择从#first部分的最后一部分中的表中获取最后一行的ID.

我正在使用以下Jquery,回到"未定义"......任何想法?

    var lastListItem = $('#first:last-child table>tbody>tr:last').attr("id");
    alert(lastListItem);
Run Code Online (Sandbox Code Playgroud)