Document.lastStyleSheetSet

Obsolete
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

The Document.lastStyleSheetSet property returns the last enabled style sheet set. This property's value changes whenever the document.selectedStyleSheetSet property is changed.

Syntax

var lastStyleSheetSet = document.lastStyleSheetSet

On return, lastStyleSheetSet indicates the style sheet set that was most recently set. If the current style sheet set has not been changed by setting document.selectedStyleSheetSet, the returned value is null.

Note: This value doesn't change when document.enableStyleSheetsForSet() is called.

Example

let lastSheetSet = document.lastStyleSheetSet;

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

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
lastStyleSheetSet
DeprecatedNon-standard
Chrome No support NoEdge No support NoFirefox Full support YesIE ? Opera ? Safari ? WebView Android No support NoChrome Android No support NoFirefox Android Full support YesOpera Android ? Safari iOS ? Samsung Internet Android No support No

Legend

Full support
Full support
No support
No support
Compatibility unknown
Compatibility unknown
Non-standard. Expect poor cross-browser support.
Non-standard. Expect poor cross-browser support.
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.

See also