/* Dans cet exemple nous considérons que styleSheet est un objet de type interface StyleSheet qui est la feuille de style de id="parentStyleSheet" */ alert(styleSheet.parentStyleSheet); //null /* On récupère la régle @import */ var Import = styleSheet.cssRules.item(0). /* On récupère interface StyleSheet d'@import */ var styleSheetImport = Import.styleSheet alert(styleSheetImport.parentStyleSheet); //object CSSStyleSheet
Valeur retournée de parentStyleSheet
Valeur retournée
L'attribut javascript StyleSheet.parentStyleSheet renvoie : - objet CSSStyleSheet, si la StyleSheet est incluse - null, si la StyleSheet n'est pas incluse