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 julio de 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 > |