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);
}

Specifications

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome No support NoEdge ? Firefox Full support YesIE ? Opera ? Safari ? WebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support YesOpera Android ? Safari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown

See also

Document Tags and Contributors

Last updated by: mfuji09,