Document.styleSheets

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2015.

Resumen

Devuelve una lista de objetos de tipo stylesheet para las hojas de estilo que están específicamente enlazadas o contenidas en el documento.

Propiedades

styleSheetList.length - devuelve el número de objetos de tipo stylesheet contenidos en el objeto.

Sintaxis

js
styleSheetList = document.styleSheets;

El objeto devuelto es del tipo StyleSheetList.

Es una colección ordenada de objetos de tipo stylesheet. styleSheetList.item(index) o simplemente styleSheetList[ index ] devuelve un único objeto de tipo stylesheet con el índice especificado (el índice es de origen 0).

Especificaciones

Specification
CSS Object Model (CSSOM)
# dom-documentorshadowroot-stylesheets

Compatibilidad del Navegador

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
styleSheets

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support