DHTML Collections
DOM Level 2 Specification.
Retrieves a collection of all the imported style sheets defined for the respective styleSheet object.
[ collImports = ] styleSheet.imports |
[ oObject = ] styleSheet.imports ( iIndex ) |
collImports |
Reference to an array of elements contained by the object. |
oObject |
Reference to an individual item in the array of elements contained by the object. |
iIndex |
Integer indicating the item to be returned. |
An imported style sheet is one that is brought into the document using the @import attribute in Cascading Style Sheets.
The following example displays the URLs of the imported style sheets in the document.
for ( i = 0; i < document.styleSheets.length; i ++ ) {
if ( document.styleSheets ( i ).owningElement.tagName == "STYLE" ) {
ilength = document.styleSheets ( i ).imports.length;
for ( j = 0; j < ilength; j ++ )
alert ( "Imported style sheet " + j + " is at " +
document.styleSheets ( i ).imports ( j ).href );
}
}
styleSheet