jQuery

基础

jQuery 插件机制插件

jQuery.fn.extend(object)//$(.div).

jQuery.extend(object)//$().

基础语法code

$(select).action()

基础选择器

$("*")   //All Select("*")

$(".class")   //Class Selector(".class")

$("element")  //Element Selector("element")

$("#id")  //ID Selector("#id")

$("selector1,selector2,selectorN") //Multipe 

Selector("selector1,selector2,selector

属性选择器

$("[attribute='value']") //Has Attribute Selector[name='value']

$("[attribute*='value']") //Attribute Contains With Selector [name*='value']

$("[attribute|='value']") //Attribute Contains Prefix Selector [name|='value']


$("[attribute^='value") //Attribute Contains Starts With Select[name^='value']

$("[attribute$='value']") //Attribute Contains Ends With Selector[name$='value']


$("[attribute!='value']") //Attribute Not Equal Select [name!='value']

$("[attribute~='value']") //Attribute Contains Word Selector[name~='value'] 空格包含value

$("[attribute1][attribute2][attributeN]") //Multipe Attribute Select [name="value"][name2="vlue2"]

基础过滤

$(":animated") //:animated querySelector

$(":eq(index") //index正值(,要匹配元素的索引值,从零开始),负值从最后一个元素开始

$(":even")  //偶数索引,零开始,024,odd奇数

$(":first") //第一个匹配的元素

$(":focus") //获取焦点的元素

$(":header") //获取标题元素h1,h2,h3

$(":last") //last Select

$(":gt(index)")  //大于

$(":lt(index)") //小于

$(":not(select)") //选择全部不匹配

子元素过滤选择器

$(":nth-child(index/even/odd/equation)")

$(":first-child") //夫级第一个子元素

$(":last-child") //夫级最后一个子元素

$(":first-of-type")