# IFrame width Property
[ 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

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](#)