HTML DOM Object Height Property

HTMLWeb DevelopmentFront End Technology

The HTML DOM Object Height property is used to set or return the height of an object. This height is set in pixels.

Following is the syntax to set the height of an object: objObject.height

Following is the syntax to return the height of an object −

objObject.height = pixels

Above, pixels is the value set for the height of object.

Let us now see an example to implement the DOM object height property −


 Live Demo

<!DOCTYPE html>
<object id="newObj" width="580" height="200" data="" style="border:2px solid red"></object>
<p>Click to update the height.</p>
<button onclick="display()">Update Height</button>
<p id="myid"></p>
   function display() {
      document.getElementById("newObj").height = "350";


Now, click the “Update Height” button to change the height −

Published on 20-Jun-2019 11:09:11