StyleSheet.ownerNode
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2015.
OwnerNode renvoie le noeud qui associe cette feuille de style au document.
Syntaxe
js
objref = stylesheet.ownerNode;
Exemple
html
<html>
<head>
<link rel="stylesheet" href="example.css" type="text/css" />
<script>
function stilo() {
alert(document.styleSheets[0].ownerNode);
}
</script>
</head>
<body>
<button onclick="stilo()">ss</button>
</body>
</html>
// affiche "objet HTMLLinkElement"
Remarques
Spécification
DOM Styles de niveau 2 - FEUILLE DE STYLES