StylePropertyMap: delete() method
Khả dụng hạn chế
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Phương thức delete() của giao diện StylePropertyMap xóa khai báo CSS với thuộc tính đã cho.
Cú pháp
js
delete(property)
Tham số
property-
Một định danh chỉ ra tính năng kiểu dáng (ví dụ: font, width, background color) cần xóa.
Giá trị trả về
Không có (undefined).
Ví dụ
Ví dụ sau xóa thuộc tính background-image khỏi thuộc tính style của phần tử.
js
// lấy phần tử button
const buttonEl = document.querySelector("button");
// xóa background-image khỏi thuộc tính style
buttonEl.attributeStyleMap.delete("background-image");
Thông số kỹ thuật
| Thông số kỹ thuật |
|---|
| CSS Typed OM Level 1> # dom-stylepropertymap-delete> |