Object height attribute

Definition and Usage

height Attribute set or return the width of the <object> element height attribute value.

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

Tip:Use width attribute Set or return the width of the <object> element width attribute value.

See also:

HTML Reference Manual:HTML <object> height Attribute

HTML Reference Manual:HTML <object> Tag

Example

Example 1

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

document.getElementById("myObject").height = "400";

Try it yourself

Example 2

Get the height of the <object> element:

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

Try it yourself

Example 3

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

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

Try it yourself

Syntax

Return the height attribute:

objObject.height

Set the height attribute:

objObject.height = pixels

Attribute value

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

Technical Details

Return Value: A number representing the height of the object in pixels.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support