นิยามและการใช้งานของ HTML DOM marginHeight

การระบุและการใช้งาน

marginHeight นั้นสามารถตั้งค่าหรือคืนค่าหรือเชิงบนและเชิงล่างของโครงการ (เป็นพิกเซล)

ระบุ

iframeObject.marginHeight=pixels

ตัวอย่าง

ตัวอย่างด้านล่างนี้สามารถคืนค่าหรือเชิงบนและเชิงล่างของ iframe ได้

<html>
<body>
<iframe src="frame_a.htm" id="frame1" marginheight="50"></iframe>
<br />
<script type="text/javascript">
x=document.getElementById("frame1");
document.write("Top and bottom margins of the iframe are: ");
document.write(x.marginHeight);
</script>
</body>
</html>