//设置CSS
Base.prototype.css= function(attr,value) {
for(var i=0;i<this.elements.length;i++){
if (arguments.length==1){
return getStyle(this.elements[i],attr);
}
this.elements[i].style[attr] = value;
}
return this;
}
TypeError: this.elements[i].style is undefined
base.js (第 75 行,第 3 列) this.elements[i].style[attr] = value; 这句老是报错,找不出来错误
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
如果学习李炎恢的教程,尽量使用相同版本的Javascript