获取class为th的table标签中的thead标签下的tr标签内部的th标签数量:
var th_count=
(
"
.
t
h
>
t
h
e
a
d
>
t
r
"
)
.
c
h
i
l
d
r
e
n
(
"
t
h
"
)
.
l
e
n
g
t
h
;
获
取
c
l
a
s
s
为
t
h
的
t
a
b
l
e
标
签
中
的
t
h
e
a
d
标
签
下
的
t
r
标
签
内
部
的
第
一
个
t
h
标
签
的
值
:
v
a
r
t
h
v
a
l
u
e
=
(".th>thead>tr").children("th").length; 获取class为th的table标签中的thead标签下的tr标签内部的第一个th标签的值: var th_value=
(".th>thead>tr").children("th").length;获取class为th的table标签中的thead标签下的tr标签内部的第一个th标签的值:varthvalue=(".th tr:eq(0) th:eq(0)).html();
获取class为th的table标签中的thead标签下的tr标签内部的th标签内部的input标签数量:
var th_input_count=
(
"
.
t
h
>
t
h
e
a
d
>
t
r
>
t
h
"
)
.
c
h
i
l
d
r
e
n
(
"
i
n
p
u
t
"
)
.
l
e
n
g
t
h
;
获
取
c
l
a
s
s
为
t
h
的
t
a
b
l
e
标
签
中
的
t
h
e
a
d
标
签
下
的
t
r
标
签
内
部
的
t
h
标
签
内
部
的
第
一
个
i
n
p
u
t
标
签
的
值
:
v
a
r
t
h
i
n
p
u
t
v
a
l
u
e
=
(".th>thead>tr>th").children("input").length; 获取class为th的table标签中的thead标签下的tr标签内部的th标签内部的第一个input标签的值: var th_input_value=
(".th>thead>tr>th").children("input").length;获取class为th的table标签中的thead标签下的tr标签内部的th标签内部的第一个input标签的值:varthinputvalue=(".th tr:eq(0) th:eq(0) input:eq(0)).val();
获取th、input标签数量和其中的值
最新推荐文章于 2022-09-05 16:01:15 发布