Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
HTML and CSS
CSS Reference
Collections
 imports Collection

  Switch on low bandwidth view
imports Collection

Retrieves a collection of all the imported style sheets defined for the respective styleSheet object.

Syntax

[ oColl = ] object.imports
[ oObject = ] object.imports(iIndex)

Possible Values

oColl Array of imported style sheets.
oObjectReference to an individual item in the array of elements contained by the object.
iIndexRequired. Integer that specifies the zero-based index of the item to be returned.

Members Table

The following table lists the members exposed by the imports object.

Attributes/Properties
Show:
PropertyDescription
length Sets or retrieves the number of objects in a collection.
MethodDescription
item Retrieves an object from a styleSheets collection or an imports collection.

Remarks

An imported style sheet is one that is brought into the document using the cascading style sheets (CSS) @import rule.

Example

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

Standards Information

There is no public standard that applies to this collection.

Applies To

styleSheet, CSSStyleSheet Constructor
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker