The x property in DOMRectReadOnly API interface is used to represents the x coordinate. It is a read-only property.
var recX = DOMRect.x;
Return Value: It returns the x coordinate of DOMRectReadOnly API.
Example: This example uses DOMRect.x property to get the x-coordinate of the DOMRect object.
- Before Click the Button:
- After Click the Button:
Supported Browsers: The browsers supported by DOMRectReadOnly x property are listed below:
- Google Chrome
- Safari 10.1
- Web API | DOMRectReadOnly y property
- CSS | transition-property Property
- CSS | all Property
- CSS | nav-right property
- CSS | top Property
- CSS | nav-down property
- CSS | right Property
- CSS | padding-right Property
- Web API | DOMRect right property
- CSS | resize Property
- CSS | align-self Property
- CSS | perspective Property
- CSS | left Property
- CSS | grid-row Property
- CSS | clip Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.