mozilla

Revision 189282 of StyleSheet.ownerNode

  • Revision slug: DOM/stylesheet/ownerNode
  • Revision title: ownerNode
  • Revision id: 189282
  • Created:
  • Creator: Ptak82
  • Is current revision? No
  • Comment pl

Revision Content

{{ DomRef() }}

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>
Thunder
  <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

{{ languages( { "pl": "pl/DOM/stylesheet.ownerNode" } ) }}

Revision Source

<p>
{{ DomRef() }}
</p>
<h3 id="Summary" name="Summary">Summary</h3>
<p><b>ownerNode</b> returns the node that associates this style sheet with the document. </p>
<h3 id="Syntax" name="Syntax">Syntax </h3>
<pre class="eval"><i>objRef</i> = stylesheet.ownerNode 
</pre>
<h3 id="Example" name="Example">Example </h3>
<pre class="eval">&lt;html&gt;
 &lt;head&gt;
  &lt;link rel="StyleSheet" href="example.css" type="text/css" /&gt;
  &lt;script&gt;
   function stilo() {
    alert(document.styleSheets[0].ownerNode);
   }
  &lt;/script&gt; 
 &lt;/head&gt;
 &lt;body&gt;
</pre> <div class="thunder">Thunder</div>
<pre class="eval">  &lt;button onclick="stilo()"&gt;ss&lt;/button&gt;
 &lt;/body&gt;
&lt;/html&gt;
// displays "object HTMLLinkElement"
</pre>
<h3 id="Notes" name="Notes">Notes </h3>
<p>For HTML, <b>ownerNode</b> may be the corresponding <a href="en/LINK">LINK</a> or <a href="en/STYLE">STYLE</a> 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. </p>
<h3 id="Specification" name="Specification">Specification </h3>
<p>DOM Level 2 Styles - STYLESHEET
</p>{{ languages( { "pl": "pl/DOM/stylesheet.ownerNode" } ) }}
Revert to this revision