importsimports*
*



Contents  *



Index  *Topic Contents
*Previous Topic: images
*Next Topic: links

imports

Description

Retrieves a collection of all the imported style sheets defined for the respective styleSheet object. An imported style sheet is one that is brought into the document using the @import attribute in CSS.

Syntax

object.imports(index)

ParameterDescription
object A styleSheet object.
(index) Optional. An integer or a string specifying the index value of the style sheet to retrieve. Integer indexes are zero-based, meaning the first style sheet in the collection has index 0.

Example

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") {
        for (j=0; j<document.styleSheets(i).imports.length; j++)
            alert("Imported style sheet " + j + " is at " + document.styleSheets(i).imports(j).href);
    }
}

Property

length

Methods

item

Applies To

styleSheet


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.