aboutsummaryrefslogtreecommitdiff
path: root/files/pl/web/api/document/documentelement/index.html
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:42:52 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:42:52 -0500
commit074785cea106179cb3305637055ab0a009ca74f2 (patch)
treee6ae371cccd642aa2b67f39752a2cdf1fd4eb040 /files/pl/web/api/document/documentelement/index.html
parentda78a9e329e272dedb2400b79a3bdeebff387d47 (diff)
downloadtranslated-content-074785cea106179cb3305637055ab0a009ca74f2.tar.gz
translated-content-074785cea106179cb3305637055ab0a009ca74f2.tar.bz2
translated-content-074785cea106179cb3305637055ab0a009ca74f2.zip
initial commit
Diffstat (limited to 'files/pl/web/api/document/documentelement/index.html')
-rw-r--r--files/pl/web/api/document/documentelement/index.html60
1 files changed, 60 insertions, 0 deletions
diff --git a/files/pl/web/api/document/documentelement/index.html b/files/pl/web/api/document/documentelement/index.html
new file mode 100644
index 0000000000..bc729c829f
--- /dev/null
+++ b/files/pl/web/api/document/documentelement/index.html
@@ -0,0 +1,60 @@
+---
+title: document.documentElement
+slug: Web/API/Document/documentElement
+tags:
+ - DOM
+ - Dokumentacja_Gecko_DOM
+ - Gecko
+ - Wszystkie_kategorie
+translation_of: Web/API/Document/documentElement
+---
+<p>{{ ApiRef() }}</p>
+
+<h3 id="Podsumowanie" name="Podsumowanie">Podsumowanie</h3>
+
+<p><strong>Tylko do odczytu</strong></p>
+
+<p>Zwraca <code><a href="pl/DOM/element">Element</a></code> będący bezpośrednim dzieckiem <a href="pl/DOM/document">document</a> (na przykład dla dokumentów HTML jest to element <code>&lt;html&gt;</code>).</p>
+
+<h3 id="Sk.C5.82adnia" name="Sk.C5.82adnia">Składnia</h3>
+
+<pre class="eval">var<em>element</em> = document.documentElement;
+</pre>
+
+<h3 id="Przyk.C5.82ad" name="Przyk.C5.82ad">Przykład</h3>
+
+<pre class="eval">actual_doc = document.documentElement;
+first_tier = actual_doc.childNodes;
+//first_tier to bezpośrednie dzieci HTML
+for (var i = 0; i &lt; first_tier.length; i++) {
+ //zrób cos z każdym dzieckiem HTML
+ //poprzez first_tier[i]
+}
+</pre>
+
+<pre class="eval">var rootElement = document.documentElement;
+var firstTier = rootElement.childNodes;
+// firstTier jest NodeList bezpośredniego dziecka elementu głównego
+for (var i = 0; i &lt; firstTier.length; i++) {
+ // zrób coś z każdym dzieckiem HTML głównego elementu
+ // as firstTier[i]
+}
+</pre>
+
+<h3 id="Uwagi" name="Uwagi">Uwagi</h3>
+
+<p>Ta własność tylko do odczytu jest udogodnieniem w przechwytywaniu elementu HTML, powiązanego z każdym prawidłowym dokumentem HTML.</p>
+
+<p>Powyżej typowy przykład: potrzebujesz w rzeczywistości elementu HTML, aby mieć dostęp do wszystkich jego dzieci, więc używasz tej własności obiektu <code>document</code>, aby go przejąć.</p>
+
+<p>Zauważ też, że zazwyczaj <code>document</code> zawiera jeden węzeł-dziecko - HTML - który sam zawiera wszystkie elementy faktycznego dokumentu jako listę węzłów-dzieci (<code>nodeList</code>).</p>
+
+<h3 id="Specyfikacja" name="Specyfikacja">Specyfikacja</h3>
+
+<p><a class="external" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-87CD092">DOM Level 2 Core: Document.documentElement</a></p>
+
+
+
+<div class="noinclude"></div>
+
+<p>{{ languages( { "en": "en/DOM/document.documentElement", "es": "es/DOM/document.documentElement", "fr": "fr/DOM/document.documentElement", "ja": "ja/DOM/document.documentElement" } ) }}</p>