首页 > 代码库 > jQuery学习笔记

jQuery学习笔记

1. 基础语法:$(selector).action()

2. 基础选择器

技术分享
1) All Seletor    $("*")2) Class Selector    $(".class")3) Element Selector    $("element")4) ID Selector    $("#id")5) Multiple Selector    $("selector1, selector2, selectorN")
View Code

3. 属性选择器

技术分享
1) Attribute Contains Prefix Selector [name|="value"]    $("[attribute|=‘value‘]")  引号可选2) Attribute COntains Selector [name*="value"]  $("attribute*=‘value‘]")3) Attribute Contains Word Selector [name~="value"]    $("[attribute~=‘value‘]")4) Attribute Equal with Selector[name="value"]    $("[attribute=‘value‘]")5) Attribute Not Equal Selector [name!="value"]    $("[attribute!=‘value‘]")6) Attribute Ends With Selector [name$="value"]    $("[attribute$=‘value‘]")7) Attribute Starts With Selector [name^="value"]    $("[attribute^=‘value‘]")8) Has Attribute Selector [name]    $("[attribute]")9) Multiple Attribute Selector [name1="value1" [name2="vallue2"]    $("[attributeFilter1][attributeFilter2][attributeFilterN]")
View Code

 4. 基础过滤器

技术分享
1) :animated Selector    $(":animated")2) :eq() Selector    a) $(":eq(index)")    b) $(":eq(-index)")3) :even Selector    $(":even")4) :first Selector    $(":first")5) :focus Selector    $(":focus")6) :header Selector    $(":header")7) :last Selector    $(":last")8) :gt() selector    a) $(":gt(index)")     b) $(":gt(-index)")9) :lt() selector    a) $(":lt(index)")    b) $(":lt(-index)")10) :not() selector    $(":not(selector)")
View Code

 

jQuery学习笔记