DOMRect: y property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨January 2020⁩.

Note: This feature is available in Web Workers.

The y property of the DOMRect interface represents the y-coordinate of the rectangle, which is the vertical distance between the viewport's top edge and the rectangle's origin.

When the rectangle's height is non-negative, the rectangle's vertical origin is the viewport's top edge. If the height has a negative height, the rectangle's vertical origin is the viewport's bottom edge.