Embed width property
Example
Modify the width of the embedded file to 500 pixels:
document.getElementById("myEmbed").width="500";
Try it »
Definition and Usage
The width property is used to set or return
The width property describes the width of the embedded file, in pixels.
Tip: Use height Use the property to set or return
Browser support





All major browsers support the width property.
Syntax
Return the width property:
embedObject
.width
Set the width property:
embedObject
.width=
pixels
Attribute values
| Value | Description |
|---|---|
| pixels | Specifies the width of the embedded file, in pixels. (e.g. width="100") |
Technical Details
| Return Value: | A Number, representing the width of the embedded content, in pixels |
|---|
More examples
Example
Return the width of the embedded file:
var x = document.getElementById("myEmbed").width;
x
The output is:
200
Try it »
Example
Modify the height and width of the embedded file to 500 pixels:
document.getElementById("myEmbed").height="500";
document.getElementById("myEmbed").width="500";
Try it »
Related pages
HTML Reference Manual: HTML
Embed object