Export (0) Print
Expand All
2 out of 3 rated this helpful - Rate this topic

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.

MethodDescription
item

Retrieves an object from a collection.

 

Properties

The imports collection has these properties.

PropertyDescription

length

Retrieves the number of properties that are explicitly set on the parent object.

length

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);
    }
}

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.