此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in English Always switch to English

Document.lastStyleSheetSet

Deprecated

Avoid using this feature in new projects. This feature may be a candidate for removal from web standards or browsers.

Document.lastStyleSheetSet 返回最后一个启用的样式表集合。当 document.selectedStyleSheetSet 属性发生变化时,这个属性的值就会随之发生变化。

返回时,lastStyleSheetSet 指示最近设置的样式表。如果当前样式表集尚未通过设置更改 document.selectedStyleSheetSet, 则返回值为 null

备注:document.enableStyleSheetsForSet() 被执行时,该值不会该变。

示例

js
let lastSheetSet = document.lastStyleSheetSet;

if (!lastSheetSet) {
  lastSheetSet = "Style sheet not yet changed";
} else {
  console.log("The last style sheet set is: " + lastSheetSet);
}

浏览器兼容性

参见