VOOZH about

URL: https://www.geeksforgeeks.org/javascript/html-dom-style-height-property/

⇱ HTML | DOM Style height Property - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML | DOM Style height Property

Last Updated : 11 Jul, 2025

HTML DOM Style height Property is similar to CSS Height Property but it is used to set or get height of an element dynamically.

Syntax : 

  • To set the height property : 
object.style.height = auto|length|%|initial|inherit;
  • To get height property value: 
object.style.height


Property Values: 

ValueDescription
autoDefault value
lengthThis define height in length unit
%This define height in percentage compare with the parent element.
initialsets its default value
inheritinherit the property from parents


Return Value: String that gives height of the element.

Example-1: 

Output 

  • Before : 
👁 HTML DOM Height Before gfg
HTML DOM Height Before
  • After : 
👁 HTML DOM Height after gfg
HTML DOM Height after


Example-2: 

Output : 

  • Before : 
👁 DOM Height example before gfg
DOM Height example before
  • After : 
👁 DOM height after gfg
DOM height after


Supported Browsers: The browser supported by DOM Style height property are listed below:

  • Google Chrome 1.0
  • Edge 12.0
  • Internet Explorer 4.0
  • Firefox 1.0
  • Opera 7.0
  • Safari 1.0
Comment
Article Tags:
Article Tags: