jquery closest方法
2020-12-13 01:55
阅读:407
标签:des style class code color get
.closest( selector )
Description: For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
使用说明:
对于集合(set)中的每一个元素, 通过在文档树中向上遍历这个元素本身和它的祖先元素,来取得第一个与选择符(selector)匹配的那个元素.
举例:
-
this is [Span] party. 12 345
$("#third").closest("div")
结果为:
2 345
jquery closest方法,搜素材,soscw.com
jquery closest方法
标签:des style class code color get
原文地址:http://blog.csdn.net/u012307002/article/details/25193719
评论
亲,登录后才可以留言!