Web API DOMRect height property
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;" > w3wiki </ 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 Chrome
- Safari 10.1
- Firefox
- Opera