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.
DOMRectList.length Read only
A read-only property that returns the total number of DOMRect objects in the DOMRectList.
DOMRectList.itemReturns the DOMRect object at the specified index. If the index is out of range, it returns null.
| Specification |
|---|
| Geometry Interfaces Module Level 1> # DOMRectList> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
DOMRectList |
612–61 | 7912–79 | 273–27 | 48≤12.1–48 | 10.14–11 | 6118–61 | 274–27 | 45≤12.1–45 | 10.33–11 | 8.01.0–8.0 | 614.4–61 | 10.33–11 |
item |
2 | 12 | 3 | ≤12.1 | 4 | 18 | 4 | ≤12.1 | 3 | 1.0 | 4.4 | 3 |
length |
2 | 12 | 3 | ≤12.1 | 4 | 18 | 4 | ≤12.1 | 3 | 1.0 | 4.4 | 3 |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/DOMRectList