Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Embed height property

Embed height property

Embed Object Reference Embed object

Example

Modify the height of the embedded file to 500 pixels:

document.getElementById("myEmbed").height="500";

Try it »


Definition and Usage

The height property is used to set or return the value of the height attribute of the element.

The height property describes the height of the embedded file, in pixels.

**Tip:** Use width Use the property to set the value of the width attribute of the element.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the height property.


Syntax

Return the height property:

embedObject

.height

Set the height property:

embedObject

.height=

pixels

Attribute values

Value Description
pixels Describes the height of the embedded content, in pixels. (e.g. height="100")

Technical Details

Return Value: Number, representing the height of the embedded file, in pixels.

More examples

Example

Return the height of the embedded file:

var x = document.getElementById("myEmbed").height;

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 height property


Embed Object Reference Embed object