Javascript examples for DOM HTML Element:IFrame
The height property sets or gets the height attribute in an iframe element.
Set the height property with the following Values
Value | Description |
---|---|
pixels | The height in pixels ("100px" or "100") |
A String, representing the height of the iframe, in pixels
The following code shows how to change the height of an iframe:
<!DOCTYPE html> <html> <body> <iframe id="myFrame" src="http://java2s.com" height="200" width="250"></iframe> <button onclick="myFunction()">Test</button> <script> function myFunction() {/*from w w w .jav a 2 s .c o m*/ document.getElementById("myFrame").height = "400"; } </script> </body> </html>