Web API DOMRect height property Last Updated : 15 Jun, 2023 Comments Improve Suggest changes Like Article Like Report In Web API there is a DOMRect Interface that has a property height which gives us the height of the DOMRect object. Syntax: letrecX = DOMRect.height; Return Type: Double value Example: Getting the height of the DOMRect object created. HTML <!DOCTYPE html> <html> <head> <title>DOMRect height property</title> </head> <body> <h1 style="color:green;"> GeeksForGeeks </h1> <h2>DOMRect height property</h2> <button onclick="getDOMRect ();"> Get height </button> <p id='DOMRect'></p> <script type="text/javascript"> function getDOMRect() { let myDOMRect = new DOMRect(0, 0, 100, 100); let recheight = myDOMRect.height; document.getElementById( 'DOMRect').innerHTML = recheight; } </script> </body> </html> Output: Supported Browsers: The browsers supported by the DOMRect height property are listed below: Google ChromeSafari 10.1FirefoxOpera Comment More infoAdvertise with us Next Article Web API DOMRect height property D DeepakDev Follow Improve Article Tags : JavaScript Web Technologies HTML Web technologies HTML-DOM Web-API +2 More Similar Reads Web API DOMRect left property In Web API there is a DOMRect Interface which has a property left that gives us the left of the DOMRect object. It returns the x coordinate value or if the width is negative then it returns x + width. Syntax: let recX = DOMRect.left; Return Type: Double value Example 1: When the width is positive HT 1 min read Web API DOMRect fromRect property In Web API there is a DOMRect Interface which has a property fromRect() which creates a DOMRectReadOnly object which has location and dimensions given. Syntax: let domRect = DOMRectReadOnly.fromRect(DOMRect object) Return Value: It returns an instance of DOMRect Example: Using fromRect. HTML <!DO 1 min read Web API DOMRect top property In Web API there is a DOMRect Interface which has a property top that gives us the top of the DOMRect object. It returns the y coordinate value or if the height is negative then it returns y + height. Syntax: let recX = DOMRect.top; Return Type: Double value Example 1: When the height is positive HT 1 min read Web API DOMRect width property In Web API there is a DOMRectReadOnly Interface which has a property width that gives us the width of the DOMRect object. Syntax: let recX = DOMRect.width; Return Type: Double value Example: Getting the width of the DOMRect object created. HTML <!DOCTYPE html> <html> <head> <tit 1 min read Web API DOMRect right property In Web API there is a DOMRect Interface that has a property right that gives us the right of the DOMRect object. It returns x + width coordinate value or if the width is negative then it returns x. Syntax: let recX = DOMRect.right; Return Type: Double value Example 1: When the width is positive HTML 1 min read Like