Firefox Tomorrow

web api instance property

DOMRect: x property

View on MDN ↗

Available in workers

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

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also