选择器是jQuery最强大的功能,其次是兼容性。现在浏览器都越来越高级了,标准也基本一致了,jQuery的兼容性优势慢慢失去
2017-12-03
Attribute就是dom节点自带的属性,就像老鼠天生会打洞。Property是为了研究老鼠,把老鼠进行归类,比如是老鼠是动物,不是植物,是哺乳动物,不是生蛋动物。。。。。。鸡是动物并不是哺乳动物,
2017-12-02
function Animal(){
this.name = "Animal";
this.showName = function(){
alert(this.name);
}
}
function Cat(){
this.name = "Cat";
}
var animal = new Animal();
var cat = new Cat();
animal.showName.call(cat,",");
结果为:Cat
this.name = "Animal";
this.showName = function(){
alert(this.name);
}
}
function Cat(){
this.name = "Cat";
}
var animal = new Animal();
var cat = new Cat();
animal.showName.call(cat,",");
结果为:Cat
2017-12-02
在某些浏览器中,选择器:checked可能会错误选取到<option>元素,所以保险起见换用选择器input:checked,确保只会选取<input>元素
2017-12-02
大部分表单类别筛选器可以使用属性筛选器替换。比如 $(':password') == $('[type=password]')
2017-12-02