前端学习笔记--document.querySelectorAl
2018-09-14 本文已影响0人
沧澈
-
for循环方式
for(var i= 0; i< document.querySelectopAll(".a").length; i ++){
document.querySelectopAll(".a")[i].style.color= "red";
}
-
forEach
借助call()实现
[].forEach.call(document.querySelectorAll(".aa"), function(){
console.log("1")
});