HTML | DOM clientHeight Property

The DOM clientHeight property is used to return the viewable height of an element in terms of the pixel. It includes the measurement of the width of padding but does not include the margin, border, and scrollbar property for the measurement of the element width. This property only returns the actual height of an element that is viewable or visible to the user It is a read-only property.



Return Value: It returns a numeric value which represent the viewable height of the element.






<!DOCTYPE html>
        HTML | DOM clientHeight Property
        h1 {
            color: green;
            font-size: 35px;
        #GFG {
            height: 100px;
            width: 350px;
            padding: 40px;
            margin: 25px;
            border: 5px solid coral;
            background-color: green;
        <h2>DOM clientHeight Property </h2>
        <div id="GFG">
            <p style="color:white;font-size:25px;">
            <p id="sudo" style="color:white;"></p>
        <button onclick="Geeks()">Submit</button>
            function Geeks() {
                var w = document.getElementById("GFG");
                // Using clientHeight property
                var x = "viewable Height is: " 
                + w.clientHeight + "px<br>";
                x += "viewable width is:: " 
                + w.clientWidth + "px";
                document.getElementById("sudo").innerHTML = x;



  • Initially:

  • After Click on the Button:

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

  • Google Chrome 1.0
  • Internet Explorer 4.0
  • Firefox 1.0
  • Opera 3.5
  • Safari 1.0

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using or mail your article to See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Article Tags :
Practice Tags :

Be the First to upvote.

Please write to us at to report any issue with the above content.