Range: phương thức detach()

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

Phương thức Range.detach() không làm gì cả. Trước đây nó dùng để vô hiệu hóa đối tượng Range và cho phép trình duyệt giải phóng các tài nguyên liên quan. Phương thức này được giữ lại để tương thích.

Cú pháp

js
detach()

Tham số

Không có.

Giá trị trả về

Không có (undefined).

Ví dụ

js
const range = document.createRange();

range.selectNode(document.getElementsByTagName("div").item(0));
range.detach();

Thông số kỹ thuật

Thông số kỹ thuật
DOM
# dom-range-detach

Tương thích trình duyệt

Xem thêm