js獲取上級、同級和下級元素

一、JQuery.parent(expr)找父親節點,能夠傳入expr進行過濾,好比$("#parent").parent() 或者$("#parent").parent(".child")對象 二、JQuery.parents(expr)查找全部祖先元素,不限於父元素方法 三、JQuery.children(expr)返回全部子節點,這個方法只會返回直接的孩子節點,不會返回全部的子孫節點next
相關文章
相關標籤/搜索