jQuery

1 选择器
1所有的

元素

$('p')

2 id选择器

$("#test")   

另一个段落

3 class选择器

  $(".test")
  

哈哈哈 类

4 更多实例

$("*")   所有元素
$(this).hide()  当前html
$('p.intro')   class 为 intro 的 

元素 $('p:first') 第一个

元素 $('ul li:first') 第一个

2 事件

1 点击事件
click:单击事件 dblclick:双击事件  mouseenter:鼠标移动到当前元素 mouseleave:离开当前元素 
$("p").click(function () {
                alert("点我了")
            })

2 键盘事件 
keypress:按键按下 keyup: 按键松开 keydown:按键按下过程
$("input").keypress(function () {
                $("span").text(i += 1);
            });
输入你的名字:
    

按键次数: 0

你可能感兴趣的:(jQuery)