--- title: Document.lastStyleSheetSet slug: Web/API/Document/lastStyleSheetSet tags: - API - CSSOM - DOM - 层叠样式表 - 引用 - 文档 translation_of: Web/API/Document/lastStyleSheetSet ---
Document.lastStyleSheetSet 返回最后一个启用的样式表集合。当 {{domxref("document.selectedStyleSheetSet")}} 属性发生变化时,这个属性的值就会随之发生变化。
var lastStyleSheetSet = document.lastStyleSheetSet
返回时, lastStyleSheetSet 指示最近设置的样式表。 如果当前样式表集尚未通过设置更改 {{domxref("document.selectedStyleSheetSet")}}, 则返回值为 null。
let lastSheetSet = document.lastStyleSheetSet;
if (!lastSheetSet) {
lastSheetSet = 'Style sheet not yet changed';
}
else {
console.log('The last style sheet set is: ' + lastSheetSet);
}
{{Compat("api.Document.lastStyleSheetSet")}}