HTML DOM height 属性
定义和用法
height 属性可设置或返回 iframe 的高度(以像素或百分比为单位)。
语法
- iframeObject.height=pixels
实例
下面的例子可更改 iframe 的高度:
- <html>
- <head>
- <script type="text/javascript">
- function changeHeight()
- {
document.getElementById("frame1").height="200";
- }
- </script>
- </head>
- <body>
- <iframe src="frame_a.htm" id="frame1" height="100"></iframe>
- <br /><br />
- <input type="button" onclick="changeHeight()"
- value="Change height" />
- </body>
- </html>