search

Home  >  Q&A  >  body text

Is there any code I can copy or view that I wrote? Can't find the mistake you made when copying it yourself?

//Set 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;


##TypeError: this.elements[i].style is undefined


base.js (line 75, column 3) this.elements[i].style[attr] = value; This sentence always reports an error and cannot be found Error


came out

雨中漫步雨中漫步2809 days ago805

reply all(1)I'll reply

  • 大家讲道理

    大家讲道理2017-05-31 09:55:46

    If you study Li Yanhui’s tutorial, try to use the same version of Javascript

    reply
    0
  • Cancelreply