前端学习笔记--document.querySelectorAl

2018-09-14  本文已影响0人  沧澈
for(var i= 0; i< document.querySelectopAll(".a").length; i ++){
        document.querySelectopAll(".a")[i].style.color= "red";
}

借助call()实现

[].forEach.call(document.querySelectorAll(".aa"), function(){ 
  console.log("1")       
});
参考:

https://www.cnblogs.com/yanze/p/5988142.html

上一篇 下一篇

猜你喜欢

热点阅读