querySelectorAll() 的用法
时间:2019-06-28 18:07:23
收藏:0
阅读:76
1.改变样式
let dom = document.querySelectorAll(‘.waListHeight .ant-table-body‘);
dom[0].style.height =‘100px‘;
let dom = document.querySelectorAll(‘.waListHeight‘);
dom[0].style.height =‘100px‘;
2.给元素添加类名
document.querySelector("html").classList.add("noscroll");
3.给元素删除类
document.querySelector("html").classList.remove("noscroll");
评论(0)