Related Articles

Related Articles

Web API | DOMRect height property
  • Last Updated : 21 Aug, 2019

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

Syntax:

var recX = DOMRect.height;

Return Type:

Double value

Example: Getting height of the DOMRect object created.

filter_none

edit
close

play_arrow

link
brightness_4
code

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

chevron_right


Output:
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

full-stack-img




My Personal Notes arrow_drop_up
Recommended Articles
Page :