当我使用getElementsByClassName时,无法访问HTMLCollection类型。
我想获取长度但是无法获取。
var documentHeader = parent.document.all['header'];
var motionClass = documentHeader.getElementsByClassName('motion');
这是motionClass的结果。
HTMLCollection []
0: div.motion
length: 1
__proto__ : HTMLColletion
如果我访问长度结果为0
我该如何解决这个问题?
document.all
。 - SLaks