Embed heightProperty

Embed 对象参考手册Embed Object

Example

Change the height of the embedded file to 500 pixels:

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

Try it yourself »

Definition and Usage

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

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

Tip:Usewidththe property to set the value of the width attribute of the <embed> element.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the height attribute.


Syntax

Return the height property:

embedObject.height

Set the height property:

embedObject.height=pixels

Property Values

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

Technical Details

Return value: A 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;
xThe output result is:
200

Try it yourself »

Example

Change the height and width of the embedded file to 500 pixels:

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

Try it yourself »


Related Pages

HTML Reference:HTML <embed> height attribute


Embed 对象参考手册Embed Object Other Extensions