-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathCSSRuleList.html
More file actions
37 lines (37 loc) · 6.56 KB
/
Copy pathCSSRuleList.html
File metadata and controls
37 lines (37 loc) · 6.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!DOCTYPE html><html><head><meta charset="utf-8"><title>CSSRuleList JavaScript API</title><meta name="description" content="Interactive API reference for the JavaScript CSSRuleList Object. A list of CSSRules. Returned from the CSSStyleSheet.cssRules property."><link rel="stylesheet" type="text/css" href="styles.css"><script type="text/javascript">var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-23450559-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();</script></head><body><script>if (sessionStorage.collapsed === 'true') {
document.body.classList.add('members-collapsed');
}
if (localStorage.theme) {
document.body.parentElement.classList.add(localStorage.theme);
}</script><div class="topnav"><a href="/">JavaScripture</a><div class="bookmarks"><a class="bookmark contribute" href="https://github.com/nkronlage/JavaScripture">Contribute via GitHub</a> <a class="bookmark" href="/feedback">Feedback</a></div></div><div class="container"><nav class="leftnav"><div id="searchContainer"><input id="searchBox" type="text" placeholder="Search (Ctrl + S)" autocomplete="false"><div id="resultsBox" style="display:none;"></div></div><div id="apichooser"><a href="#" onclick="openApiChooser(); return false;"><div class="arrow"></div><span id="selectedsets"></span></a><div id="obscure"></div><div id="apisets"><ul></ul></div></div><div class="toc"><h2>CSSRuleList</h2><div class="navgroup"><div class="group"><a href="#InstanceIndexers">Instance Indexers</a></div><div class="group collapsed"><a href="#InstanceProperties" onclick="expandoClicked(this.parentNode); return false;"><div class="arrow"></div>Instance Properties</a><div class="subgroup"><a href="#length">length</a></div></div><div class="group collapsed"><a href="#InstanceMethods" onclick="expandoClicked(this.parentNode); return false;"><div class="arrow"></div>Instance Methods</a><div class="subgroup"><a href="#item_Number">item</a></div></div></div><h2>CSS API</h2><div id="related-apis" class="navgroup"></div><h2>All API</h2><div id="rootObjs" class="navgroup"><span class="empty">No API set selected.</span></div></div></nav><div class="content"><h1 class="declaration"><span class="object">CSSRuleList</span> <span class="type">: <a href="/Object">Object</a></span></h1><div class="metadata"></div><div class="objectdescription">A list of <a href="/CSSRule">CSSRules</a>. Returned from the <a href="/CSSStyleSheet#cssRules"><code>CSSStyleSheet.cssRules</code></a> property.<div class="membermetadata"><a href="http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRuleList" class="spec">Spec</a></div></div><div><a name="InstanceIndexers"></a><h2>Instance Indexers</h2><div class="member"><div class="expand-members" title="Toggle showing all descriptions and examples"></div><a name="indexer_Number"></a><div class="declaration"><span class="membername primary">this</span>[<span class="membername">index</span> : <a class="membertype" href="/Number">Number</a>] : <a class="membertype" href="/CSSRule">CSSRule</a> <span class="metadata">readonly</span></div><div class="member-body"><p class="description">Returns the CSSRule at the specified <code>index</code>. You can also use the <a href="#item"><code>item()</code></a> method to retrieve the item.</p><div class="htmlexample"><div class="codePanel"><h4>Example:</h4><textarea class="code" rows="19" cols="60" wrap="off">
<style>
#foo { color: red; }
span { font-weight: bold; }
</style>
<span id='foo'>foo</span>
<script>
var cssRules = document.styleSheets[0].cssRules;
for (var i = 0; i < cssRules.length; i++) {
// The following ways to index into the list are equivalent
console.log(cssRules[i].cssText);
console.log(cssRules.item(i).cssText);
}
</script>
</textarea><a onclick='executeHTMLExample(this.parentNode.parentNode, "CSSRuleList.undefined"); return false' href="#" class="run">Run</a></div><div class="resultsPanel"><h4>Results:</h4><div style="position: relative"><div class="htmlerrormessage" style="display: none"></div><iframe class="output" width="350" height="200"></iframe><pre class="results"> </pre></div></div></div><p></p></div></div></div><div><a name="InstanceProperties"></a><h2>Instance Properties</h2><div class="member"><div class="expand-members" title="Toggle showing all descriptions and examples"></div><a name="length"></a><div class="declaration"><span class="membername primary">length</span> : <a class="membertype" href="/Number">Number</a> <span class="metadata">readonly</span></div><div class="member-body"><p class="description">The number of CSSRules in the list.</p><div class="htmlexample"><div class="codePanel"><h4>Example:</h4><textarea class="code" rows="19" cols="60" wrap="off">
<style>
#foo { color: red; }
#foo { font-weight: bold; }
</style>
<span id='foo'>foo</span>
<script>
var cssRules = document.styleSheets[0].cssRules;
console.log(cssRules.length);
</script>
</textarea><a onclick='executeHTMLExample(this.parentNode.parentNode, "CSSRuleList.length"); return false' href="#" class="run">Run</a></div><div class="resultsPanel"><h4>Results:</h4><div style="position: relative"><div class="htmlerrormessage" style="display: none"></div><iframe class="output" width="350" height="200"></iframe><pre class="results"> </pre></div></div></div><p></p></div></div></div><div><a name="InstanceMethods"></a><h2>Instance Methods</h2><div class="member"><div class="expand-members" title="Toggle showing all descriptions and examples"></div><a name="item"></a> <a name="item_Number"></a><div class="declaration"><span class="membername primary">item</span>(<span class="membername">index</span> : <a class="membertype" href="/Number">Number</a>) : <a class="membertype" href="/CSSRule">CSSRule</a></div><div class="member-body"><p class="description">Same as <a href="#indexer_Number"><code>this[index]</code></a>.</p></div></div></div><div class="bottomnav"><a href="/">home</a> <a href="/license">license</a> <a href="https://github.com/nkronlage/JavaScripture">contribute</a> <a href="/feedback">feedback</a> <a id="toggle-theme" href="#">toggle light/dark mode</a></div><div class="copyright">Copyright © JavaScripture Contributors</div></div></div></body><script src="javascripture.js"></script></html>