jquery基本语法
$(selector).action()
$代表jquery
selector获取元素
action对获取到的元素做的操作
jq选择器
基本选择器
#id
element
.class
*
层级选择器
ancestor descendant
parent>child
prev+next
prev~siblings
基本筛选器
:first
:not(selector)
:even
:odd
:eq(index)
:gt(index)
:lang
:last
:lt(index)
:header
:animated
:focus
:root
:target
属性选择器
属性
[attribute]
[attribute=value]
[attribute!=value]
[attribute^=value]
[attribute$=value]
[attribute*=value]
表单对象属性选择器
表单对象属性
:enabled
:disabled
:checked
:selected
jq常用事件
鼠标事件 | 键盘事件 | 表单事件 |
click | keydown | submit |
dblclick | keyup | change |
mouseenter | keypress | focus |
mouseleave | blur | |
hover |