DOMRectList

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.

The DOMRectList interface represents a collection of DOMRect objects, typically used to hold the rectangles associated with a particular element, like bounding boxes returned by methods such as getClientRects(). It provides access to each rectangle in the list via its index, along with a length property that indicates the total number of rectangles in the list.

Note: DOMRectList exists for compatibility with legacy Web content and is not recommended to be used when creating new APIs.

Instance properties

DOMRectList.length Read only

A read-only property that returns the total number of DOMRect objects in the DOMRectList.

Instance methods

DOMRectList.item

Returns the DOMRect object at the specified index. If the index is out of range, it returns null.

Specifications

Specification
Geometry Interfaces Module Level 1
# DOMRectList

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
DOMRectList
item
length

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Uses a non-standard name.
Has more compatibility info.

See also