Document.styleSheets

  • Revision slug: DOM/document.styleSheets
  • Revision title: document.styleSheets
  • Revision id: 18922
  • Created:
  • Creator: MMM
  • Is current revision? No
  • Comment Attempting to fix broken mediawiki call.; 3 words added, 7 words removed

Revision Content

{{ DomRef() }}

Summary

Returns a list of stylesheet objects for stylesheets explicitly linked into or embedded in a document.

Syntax

var styleSheetList = document.styleSheets;

The returned object is a StyleSheetList.

It is an ordered collection of stylesheet objects. styleSheetList.item(index) or simply styleSheetList{{ mediawiki.External('index') }} returns a single stylesheet object by its index (index is 0-based).

Properties

length - returns the number of stylesheet objects contained in the object.

Syntax 

var styleSheetsNum = document.styleSheets.length;

Specification

DOM Level 2 Style: styleSheets

{{ languages( { "ja": "ja/DOM/document.styleSheets", "pl": "pl/DOM/document.styleSheets" } ) }}

Revision Source

<p>{{ DomRef() }}</p>
<h3 name="Summary">Summary</h3>
<p>Returns a list of <a href="/en/DOM/stylesheet" title="en/DOM/stylesheet">stylesheet</a> objects for stylesheets explicitly linked into or embedded in a document.</p>
<h3 name="Properties">Syntax</h3>
<pre class="eval"><em>var styleSheetList</em> = <em>document</em>.styleSheets;
</pre>
<p>The returned object is a <a class="external" href="http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheetList" title="http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheetList">StyleSheetList</a>.</p>
<p>It is an ordered collection of <a href="/en/DOM/stylesheet" title="en/DOM/stylesheet">stylesheet</a> objects. <code><em>styleSheetList</em>.item(<em>index</em>)</code> or simply <code><em>styleSheetList</em>{{ mediawiki.External('index') }}</code> returns a single stylesheet object by its index (<code>index</code> is 0-based).</p>
<h3 name="Properties">Properties</h3>
<p><code>length</code> - returns the number of stylesheet objects contained in the object.</p>
<h3>Syntax </h3>
<pre><em><code><font face="Courier New">var styleSheetsNum = document.styleSheets.length;</font></code></em></pre>
<h3 name="Specification">Specification</h3>
<p><a class="external" href="http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-DocumentStyle-styleSheets">DOM Level 2 Style: styleSheets</a></p>
<p>{{ languages( { "ja": "ja/DOM/document.styleSheets", "pl": "pl/DOM/document.styleSheets" } ) }}</p>
Revert to this revision