Range: phương thức getClientRects()
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
Phương thức getClientRects() của giao diện Range trả về danh sách các đối tượng DOMRect tổng hợp kết quả của Element.getClientRects() cho mọi phần tử trong Range.
Cú pháp
js
getClientRects()
Tham số
Không có.
Giá trị trả về
Danh sách các đối tượng DOMRect.
Ví dụ
js
const range = document.createRange();
range.selectNode(document.getElementsByTagName("div").item(0));
const rects = range.getClientRects();
Thông số kỹ thuật
| Specification |
|---|
| CSSOM View Module> # dom-range-getclientrects> |