关于html改变css的方法
window.getComputedStyle(document.getElementById('id'),null).getPropertyValue('width');
window.getComputedStyle获取浏览器最后渲染出来的css样式。
document.getElementById('id')获取一个对象的引用,document.getElementById('id').style能够获取并改写样式,但是不能够获取到样式表的内容。
window.getComputedStyle(document.getElementById('id'),null).getPropertyValue('width');
window.getComputedStyle获取浏览器最后渲染出来的css样式。
document.getElementById('id')获取一个对象的引用,document.getElementById('id').style能够获取并改写样式,但是不能够获取到样式表的内容。