YouTip LogoYouTip

Prop Iframe Width

# IFrame width Property [![Image 8: Frame/IFrame Object Reference](#) Frame/IFrame Object](#) * * * ## Definition and Usage The width property sets or returns the value of the width attribute of an iframe element. The width property specifies the width of the iframe. ## Syntax iframeObject.width=_value_ The width property can have the following values: | Value | Description | | :--- | :--- | | pixels | The width in pixels (e.g. "100px" or "100") | | % | The width in percent (e.g. "20%") | * * * ## Browser Support ![Image 9: Internet Explorer](#)![Image 10: Firefox](#)![Image 11: Opera](#)![Image 12: Google Chrome](#)![Image 13: Safari](#) The width property is supported in all major browsers. * * * ## Example ## Example Change the height and width of an iframe: function changeSize(){ document.getElementById("myframe").height="300"; document.getElementById("myframe").width="300"; }

Your browser does not support iframes.



[Try it yourself Β»](#) * * Frame/IFrame Object](#)
← Event Frame OnloadProp Frame Src β†’