javascript - Why is an error reported here?
黄舟
黄舟 2017-07-05 10:36:25
0
4
651

How to modify

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(4)
我想大声告诉你

The error is very obvious. There is no style attribute in this.contentli[i]

If you are not sure, just print the line aboveconsole.log(this.contentli[i]);

给我你的怀抱

Try console.log(this.contentli[i]). If the returned object is not a DOM object, then the code is wrong. .

学霸

The this.contentli[i].style attribute cannot be accessed because the this.contentli[i] attribute is undefined, and the .style of an undefined object cannot of course be accessed.

First check the value of this.contentli[i] when you run it, and then combine the above code that defines this.contentli[i] to troubleshoot why this.contentli[i] is not defined.

曾经蜡笔没有小新

this.contentli[i] is undefined, and it should be that the value of i exceeds this.contentli.length - 1, which is the maximum subscript of this.contentli.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template