国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

javascript - js obtains the object, but why is the attribute value of the object undefined?
PHPz
PHPz 2017-05-18 10:47:57
0
1
1062

Use JS to dynamically add the td tag, and set a class to bg_red. Then after the page is loaded, I want to get this class, var a = document.getElementByClassName('bg_red') to get it, I use console.log( typeof a) prints out an object, and console.log(a) does have many attribute values ??in it. Why is it undefined when I use console.log(a[0])? The length of a is 300, but the value printed by console.log(a.length) is 0. Why? The picture is as follows:

PHPz
PHPz

學(xué)習(xí)是最好的投資!

reply all(1)
洪濤

However, there is no problem with the same code

There is also a problem with getElementsByClassName (missing an s);

Maybe it’s the browser? ? ?

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