摘要: arr.forEach(); let arr = [1,2,3,4]; arr.forEach(function(a,b){ // 第一个参数就是 数组的列表 console.log(a);//1,2,3,4 // 第二个参数是 下标 console.log(b);//0,1,2,3 }); let 阅读全文
posted @ 2020-01-15 10:49 JackAfan 阅读(123) 评论(0) 推荐(0)
setTimeout(function(){ let aImg = document.querySelectorAll("img"); aImg.forEach(img=>{ img.alt = "" }) console.log("去除img-alt成功") },1000)