MDN self-hosted library · e01.org

DOMRect: x property

Geometry Interfaces

no runnable cells web-api-instance-property upstream source

Geometry Interfaces

The x property of the DOMRect interface represents the x-coordinate of the rectangle, which is the horizontal distance between the viewport's left edge and the rectangle's origin.

When the rectangle's width is non-negative, the rectangle's horizontal origin is the viewport's left edge. If the width is negative, the rectangle's horizontal origin is the viewport's right edge.

Value

A double.

Specifications

Browser compatibility

See also

  • DOMRectReadOnly