Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App

Related Articles

Web API | DOMRect height property

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

In Web API there is a DOMRect Interface which has a property height which gives us the height of the DOMRect object.


var recX = DOMRect.height;

Return Type:

Double value

Example: Getting height of the DOMRect object created.

<!DOCTYPE html>
    <title>DOMRect height property</title>
        <h1 style="color:green;">  
        <h2>DOMRect height property</h2>
        <button onclick="getDOMRect ();">
          Get height
        <p id='DOMRect'></p>
<script type="text/javascript">
    function getDOMRect() {
        var myDOMRect = new DOMRect(0, 0, 100, 100);
        var recheight = myDOMRect.height;
          'DOMRect').innerHTML = recheight;

Before clicking the button:

After clicking the button:

Supported Browsers: The browsers supported by DOMRect height property are listed below:

  • Google Chrome
  • Safari 10.1
  • Firefox
  • Opera
My Personal Notes arrow_drop_up
Last Updated : 21 Aug, 2019
Like Article
Save Article
Similar Reads
Related Tutorials