IFrame width Property - Change the height and width of an iframe: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:IFrame

Description

IFrame width Property - Change the height and width of an iframe:

Demo Code

ResultView the demo in separate window

<!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";
    document.getElementById("myFrame").width = "400";
}
</script>

</body>
</html>

Related Tutorials