1.$符号由来
$是函数,可以用jQuery代替.
jQuery有两个对象,$().....$.get();
2.jQuery和dom对象的关系
如果要互相调用,就必须转成对应得对象,才可以调用
dom对象是jQuery的数组组成部分.
$(h2)[0].style.background="blue"; (jquery转成dom,应用了dom方法)
$(dv).css('background','blue');
3.each遍历方法
①对象,数组遍历
$().each(对象,数组,function(){
});
③$("li").each(function(){
});
4.加载事件及与传统事件的区别
①$(document).ready(function(){
});
②$().ready(function(){
})
③$(function(){
})
5.简单事件
①$("").
6.文档操作
追加:(父子)
append() appendTo()
prepend() prependTo()
(兄弟)
after() insertAfter()
before() insertBefore()
替换:
replaceAll()
replaceWith()
复制:
clone()
clone(true/false);
删除:
empty();
remove();
7.属性选择器
[name]
[name=value] ! ^ & *
浙公网安备 33010602011771号