HTML DOM Object height Property
THE WORLD'S LARGEST WEB DEVELOPER SITE

Object height Property

❮ Object Object

Example

Change the height of an <object> element to 400px:

document.getElementById("myObject").height = "400";
Try it Yourself »

More "Try it Yourself" examples below.


Definition and Usage

The height property sets or returns the value of the height attribute of an <object> element.

The height attribute specifies the height of an object, in pixels.

Tip: Use the width property to set or return the value of the width attribute of an <object> element.


Browser Support

Property
height Yes Yes Yes Yes Yes

Syntax

Return the height property:

objObject.height

Set the height property:

objObject.height = pixels

Property Values

Value Description
pixels Specifies the height of the object, in pixels (e.g. height="100")


Technical Details

Return Value: A Number, representing the height of the object, in pixels

More Examples

Example

Get the height of an <object> element:

var x = document.getElementById("myObject").height;
Try it Yourself »

Example

Change the height and width of an <object> element to 300px:

document.getElementById("myObject").height = "500";
document.getElementById("myObject").width = "500";
Try it Yourself »

Related Pages

HTML reference: HTML <object> height attribute


❮ Object Object