asp.net.ph

Skip Navigation Links

imports Collection

DHTML Collections


DOM Level 2 Specification.

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

Syntax


[ collImports = ] styleSheet.imports
[ oObject = ] styleSheet.imports ( iIndex )

Possible Values


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.

Remarks

An imported style sheet is one that is brought into the document using the @import attribute in Cascading Style Sheets.

Members



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" ) {
      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 );
   }
}
Applies To

styleSheet



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note