StyleSheet: disabled 屬性
StyleSheet 介面的 disabled 屬性用於確定是否阻止樣式表應用於文件。
可以透過手動將此屬性設定為 true 來停用樣式表,或者如果它是一個不活動的 替代樣式表。請注意,disabled === false 並不保證樣式表已被應用(例如,它可能已被從文件中移除)。
值
布林值。
示例
js
// If the stylesheet is disabled
if (stylesheet.disabled) {
// Apply styles in-line
}
規範
| 規範 |
|---|
| CSS 物件模型 (CSSOM) # dom-stylesheet-disabled |
瀏覽器相容性
載入中…