--- title: StyleSheet.disabled slug: Web/API/StyleSheet/disabled tags: - API - CSSOM - Disabled - Property - Reference translation_of: Web/API/StyleSheet/disabled ---
disabled
属性用于决定样式表是否被禁用于文档。disabled == false
并不保证样式表一定生效(例如它可能被移除出文档)。bool = stylesheet.disabled
// 如果样式表被禁用 if (stylesheet.disabled) { // 添加行内样式 }
规范 | 状态 | 注释 |
---|---|---|
{{SpecName("CSSOM", "#dom-stylesheet-disabled", "StyleSheet.disabled")}} | {{Spec2("CSSOM")}} | No change from {{SpecName("DOM2 Style")}}. |
{{SpecName("DOM2 Style", "stylesheets.html#StyleSheets-StyleSheet-disabled", "StyleSheet.disabled")}} | {{Spec2("DOM2 Style")}} | Initial definition. |
{{Compat("api.StyleSheet.disabled")}}