(" #dv ").childen(" li ")javascript
$(" #dv ").find(" li ")css
$(" #dv ").parent()java
$(" #dv ").parents()this
向上遍歷a標籤到div標籤之間的全部元素 $(" a ").parentUntil("div")spa
1.next();.net
$(this).next().css("backgroundColor","green");code
2.nextAll();對象
$(this).nextAll().css("backgroundColor","green");索引
3.nextUntil();ip
同級遍歷 li1 標籤到 li2 標籤之間的全部元素 $("# li1 ").nextUntil("# li2")
4.prev();
$(this).prev().css("backgroundColor","green");
5.prevAll();
$(this).prevAll().css("backgroundColor","green");
6.prevUntil();
同級遍歷 li1 標籤到 li2 標籤之間的全部元素 $("# li1 ").prevUntil("# li2")
7.siblings();
$(this).siblings().css("backgroundColor","green");
1.first();
得到第一個p標籤元素 $(「div p」).first();
2.last();
得到最後一個p標籤元素 $(「div p」).last();
3.eq(index);
得到第四個p標籤元素 $(「div p」).eq(3);
4.filter();
過濾全部不是 cls樣式的標籤元素 $(this).filter(".cls");
5.not();
過濾全部是 cls樣式的標籤元素 $(this).not(".cls");
$("#uu>li").each(function (index,element) {
//第一個參數是索引,第二個參數是對象
$(element).css("opacity",(index+1)/10);
});
複製代碼