且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

jquery中find和nearest之间的区别

更新时间:2023-12-04 12:01:10

nearest()是上树,进入父母,包括当前元素。 find()正在向下查看孩子的树,以及孩子的孩子:

closest() is to go up the tree, into the parents, including the current element. find() is going down the tree looking in the childs, and the childs of childs:

var form1 = $("input").closest("form").attr("action");