Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

StyleSheet.ownerNode

我们的志愿者还没有将这篇文章翻译为 中文 (简体)加入我们帮助完成翻译!

Summary

ownerNode returns the node that associates this style sheet with the document.

Syntax

objRef = stylesheet.ownerNode 

Example

<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>
// displays "object HTMLLinkElement"

Notes

For HTML, ownerNode may be the corresponding LINK or STYLE element. For XML, it may be the linking processing instruction. For style sheets that are included by other style sheets, the value of this attribute is NULL.

Specification

DOM Level 2 Styles - STYLESHEET

文档标签和贡献者

 此页面的贡献者: fscholz, teoli, kscarfone, Sheppy, ethertank, Ptak82, Dria, JesseW
 最后编辑者: fscholz,