找到最后一个< td>每个< tr>使用JQuery [英] Finding last <td> of each <tr> using JQuery

查看:69
本文介绍了找到最后一个< td>每个< tr>使用JQuery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个具有相同类名"Test"的表,我需要使用JQuery找出每个第一个表的最后一个

I had two tables with same class name "Test", I need to find out last of each of first table using JQuery

请帮帮我.

推荐答案

jQuery 1.1.4引入了最后一个选择器:

jQuery 1.1.4 introduced the last-child selector:

说明:选择所有元素作为其父元素的最后一个子元素.

Description: Selects all elements that are the last child of their parent.

:last仅匹配一个元素时,:last-child可以匹配多个:每个父元素都匹配一个.

While :last matches only a single element, :last-child can match more than one: one for each parent.

$("table:first tr td:last-child");

这篇关于找到最后一个< td>每个< tr>使用JQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆