大致思路就是:
1.先给标签加上class
2.通过getElementsByClassName找到各个对象
3.遍历,拿到每个对象
4.使用style就可以直接修改了
var no_lines =document.getElementsByClassName("no_line");
for(i in no_lines){
console.log(no_lines[i]);
no_lines[i].style.color="yellow";
}
大致思路就是:
1.先给标签加上class
2.通过getElementsByClassName找到各个对象
3.遍历,拿到每个对象
4.使用style就可以直接修改了
var no_lines =document.getElementsByClassName("no_line");
for(i in no_lines){
console.log(no_lines[i]);
no_lines[i].style.color="yellow";
}