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


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.


let lastSheetSet = document.lastStyleSheetSet;

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


Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
lastStyleSheetSetChrome No support NoEdge ? Firefox Full support YesIE ? Opera ? Safari ? WebView Android No support NoChrome Android No support NoFirefox Android Full support YesOpera Android ? Safari iOS ? Samsung Internet Android ?


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

See also