顺便说一句,您不需要在设置数组 divsList 之前声明它.就这样做:BTW, you do not need to declare the array divsList before you set it. Just do:var divsList = document.querySelectorAll(".prefImg"); 这篇关于Javascript document.getElementsByClassName 返回未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-11 08:51