获取父级父级元素的子元素的第一个

<tr>
    <th>1</th>
    <th>2</th>
    <th>3</th>
    <th>
        <input type="button" value="详情" class="yushen_btn">
    </th>
</tr>
$(function(){
   $('.yushen_btn').click(function () {
     alert($(this).parent().parent().find("th:eq(0)").text());

   })

}

猜你喜欢

转载自blog.csdn.net/Guoyu1_/article/details/89083577