1. 程式人生 > >jQuery 篩選器2

jQuery 篩選器2

microsoft first 指定 size ros tro hasclass 元素 col

jQuery 篩選器2

// 由於$()只能輸入字符串$(‘#li:eq(1)‘),可通過.eq()來傳入。
// 獲取this標簽中的指定屬性
$(this).eq(1)

// 獲取第一個元素
$(this).first()    

// 獲取最後一個元素
$(this).last()        

// 檢查當前元素是否含有某個特定類,有返回true,沒有false。
$(this).hasClass(class)

jQuery 篩選器2