这里是我的代码如何阅读DIV
<script>
function showin(box) {
cur = parseInt(document.getElementById(box).style.marginTop);
alert(cur);
}
showin('child');
</script>
<div id="parent" class="parent">
<div id="child" class="child" style="margin-top:-10px;">
</div>
</div>
为什么它不给我任何警告信息的上边距?
虽然这是正确的,请注意OP没有指定他使用jQuery。 – techfoobar 2013-03-01 18:50:51