js如何獲取div的高度?代碼如下:
<script type="text/javascript">
window.onload = function(){</script>
其中:document.getElementById("top").offsetHeight
意思為獲取ID為top的div的高度。
或者使用:
document.getElementById(
"div1"
).style.height
意思為獲取ID為div1的div的高度。
!評(píng)論內(nèi)容需包含中文