imports collection
Retrieves a collection of all the imported style sheets defined for the respective styleSheet object.
Members
The imports collection has these types of members:
Methods
The imports collection has these methods.
| Method | Description |
|---|---|
| item |
Retrieves an object from a collection. |
Properties
The imports collection has these properties.
| Property | Description |
|---|---|
|
Retrieves the number of properties that are explicitly set on the parent object. | |
|
Sets or retrieves the number of objects in a collection. |
Remarks
An imported style sheet is one that is brought into the document using the cascading style sheets (CSS) @import rule.
Examples
This example shows how to display the URL paths of the imported style sheets in the document.
for ( i = 0; i < document.styleSheets.length; i++ ) { if ( document.styleSheets(i).owningElement.tagName == "STYLE" ) { for ( j = 0; j < document.styleSheets(i).imports.length; j++ ) alert("Imported style sheet " + j + " is at " + document.styleSheets(i).imports(j).href); } }
Show: