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 | nav-right property
- CSS | nav-down property
- CSS | top Property
- CSS | right Property
- CSS | all Property
- CSS | nav-up property
- CSS | animation-name Property
- CSS | max-height Property
- CSS | min-height Property
- CSS | columns Property
- CSS | border-right Property
- CSS | clip Property
- CSS | margin-right 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.