读取
var div = document.getElementById("myDiv");
var computedStyle = getComputedStyle(div, null); alert(computedStyle.marginTop);
设置
document.getElementById("ex1").style.marginBottom="100px";
读取
var div = document.getElementById("myDiv");
var computedStyle = getComputedStyle(div, null); alert(computedStyle.marginTop);
设置
document.getElementById("ex1").style.marginBottom="100px";