From db26cf86829f9b43d29f18b9bbf197e9e2d55c31 Mon Sep 17 00:00:00 2001 From: MDN <actions@users.noreply.github.com> Date: Wed, 14 Apr 2021 00:11:31 +0000 Subject: [CRON] sync translated content --- files/es/_redirects.txt | 1 + files/es/_wikihistory.json | 16 +-- .../web/api/parentnode/children/index.html | 158 +++++++++++++++++++++ files/es/web/api/parentnode/children/index.html | 157 -------------------- files/fr/_redirects.txt | 1 + files/fr/_wikihistory.json | 20 +-- .../web/api/parentnode/children/index.html | 90 ++++++++++++ files/fr/web/api/parentnode/children/index.html | 89 ------------ files/it/_redirects.txt | 1 + files/it/_wikihistory.json | 12 +- .../web/api/parentnode/children/index.html | 96 +++++++++++++ files/it/web/api/parentnode/children/index.html | 95 ------------- files/ja/_redirects.txt | 1 + files/ja/_wikihistory.json | 14 +- .../web/api/parentnode/children/index.html | 95 +++++++++++++ files/ja/web/api/parentnode/children/index.html | 94 ------------ files/ko/_redirects.txt | 1 + files/ko/_wikihistory.json | 12 +- .../web/api/parentnode/children/index.html | 86 +++++++++++ files/ko/web/api/parentnode/children/index.html | 85 ----------- files/pl/_redirects.txt | 6 + files/pl/_wikihistory.json | 12 +- .../web/api/parentnode/children/index.html | 97 +++++++++++++ files/pl/web/api/parentnode/children/index.html | 96 ------------- files/pt-br/_redirects.txt | 1 + files/pt-br/_wikihistory.json | 12 +- .../web/api/parentnode/children/index.html | 132 +++++++++++++++++ files/pt-br/web/api/parentnode/children/index.html | 131 ----------------- files/ru/_redirects.txt | 1 + files/ru/_wikihistory.json | 20 +-- .../web/api/parentnode/children/index.html | 144 +++++++++++++++++++ files/ru/web/api/parentnode/children/index.html | 143 ------------------- files/zh-cn/_redirects.txt | 5 +- files/zh-cn/_wikihistory.json | 22 +-- .../web/api/parentnode/children/index.html | 118 +++++++++++++++ files/zh-cn/web/api/parentnode/children/index.html | 117 --------------- files/zh-tw/_redirects.txt | 1 + files/zh-tw/_wikihistory.json | 12 +- .../web/api/parentnode/children/index.html | 153 ++++++++++++++++++++ files/zh-tw/web/api/parentnode/children/index.html | 152 -------------------- 40 files changed, 1262 insertions(+), 1237 deletions(-) create mode 100644 files/es/orphaned/web/api/parentnode/children/index.html delete mode 100644 files/es/web/api/parentnode/children/index.html create mode 100644 files/fr/orphaned/web/api/parentnode/children/index.html delete mode 100644 files/fr/web/api/parentnode/children/index.html create mode 100644 files/it/orphaned/web/api/parentnode/children/index.html delete mode 100644 files/it/web/api/parentnode/children/index.html create mode 100644 files/ja/orphaned/web/api/parentnode/children/index.html delete mode 100644 files/ja/web/api/parentnode/children/index.html create mode 100644 files/ko/orphaned/web/api/parentnode/children/index.html delete mode 100644 files/ko/web/api/parentnode/children/index.html create mode 100644 files/pl/orphaned/web/api/parentnode/children/index.html delete mode 100644 files/pl/web/api/parentnode/children/index.html create mode 100644 files/pt-br/orphaned/web/api/parentnode/children/index.html delete mode 100644 files/pt-br/web/api/parentnode/children/index.html create mode 100644 files/ru/orphaned/web/api/parentnode/children/index.html delete mode 100644 files/ru/web/api/parentnode/children/index.html create mode 100644 files/zh-cn/orphaned/web/api/parentnode/children/index.html delete mode 100644 files/zh-cn/web/api/parentnode/children/index.html create mode 100644 files/zh-tw/orphaned/web/api/parentnode/children/index.html delete mode 100644 files/zh-tw/web/api/parentnode/children/index.html diff --git a/files/es/_redirects.txt b/files/es/_redirects.txt index 00ecdbc826..751961e8eb 100644 --- a/files/es/_redirects.txt +++ b/files/es/_redirects.txt @@ -1832,6 +1832,7 @@ /es/docs/Web/API/NonDocumentTypeChildNode/previousElementSibling /es/docs/Web/API/Element/previousElementSibling /es/docs/Web/API/Notifications_API/Usando_la_API_de_Notificaciones /es/docs/Web/API/Notifications_API/Using_the_Notifications_API /es/docs/Web/API/ParentNode/childElementCount /es/docs/Web/API/Element/childElementCount +/es/docs/Web/API/ParentNode/children /es/docs/orphaned/Web/API/ParentNode/children /es/docs/Web/API/Position /es/docs/Web/API/GeolocationPosition /es/docs/Web/API/Push_API/Using_the_Push_API /es/docs/conflicting/Web/API/Push_API /es/docs/Web/API/RandomSource /es/docs/conflicting/Web/API/Crypto/getRandomValues diff --git a/files/es/_wikihistory.json b/files/es/_wikihistory.json index a2a124aec6..f2fcc7d5f9 100644 --- a/files/es/_wikihistory.json +++ b/files/es/_wikihistory.json @@ -5871,14 +5871,6 @@ "Kyuoraku" ] }, - "Web/API/ParentNode/children": { - "modified": "2019-03-23T22:32:44.383Z", - "contributors": [ - "AlePerez92", - "aeroxmotion", - "Grijander81" - ] - }, "Web/API/ParentNode/firstElementChild": { "modified": "2019-03-23T22:32:44.779Z", "contributors": [ @@ -23743,5 +23735,13 @@ "contributors": [ "joselix" ] + }, + "orphaned/Web/API/ParentNode/children": { + "modified": "2019-03-23T22:32:44.383Z", + "contributors": [ + "AlePerez92", + "aeroxmotion", + "Grijander81" + ] } } \ No newline at end of file diff --git a/files/es/orphaned/web/api/parentnode/children/index.html b/files/es/orphaned/web/api/parentnode/children/index.html new file mode 100644 index 0000000000..f8ae9e5831 --- /dev/null +++ b/files/es/orphaned/web/api/parentnode/children/index.html @@ -0,0 +1,158 @@ +--- +title: ParentNode.children +slug: orphaned/Web/API/ParentNode/children +tags: + - API + - DOM + - ParentNode + - Propiedad +translation_of: Web/API/ParentNode/children +original_slug: Web/API/ParentNode/children +--- +<p>{{ APIRef("DOM") }}</p> + +<p><code><strong>Node.children</strong></code> es una propiedad de sólo lectura que retorna una {{domxref("HTMLCollection")}} "viva" de los elementos hijos de un <code>Node</code>.</p> + +<h2 id="Sintaxis">Sintaxis</h2> + +<pre class="syntaxbox">var <em>children</em> = <em>node</em>.children; </pre> + +<p><code><var>children</var></code> es una {{ domxref("HTMLCollection") }}, que es una colección ordenada de los elementos DOM que son hijos <code>de <em>node</em></code>. Si no hay elementos hijos, entonces <code><var>children</var></code> no contendrá elementos y su longitud ( <code>length</code> ) será <code>0</code>.</p> + +<h2 id="Ejemplo">Ejemplo</h2> + +<pre class="brush: js">var foo = document.getElementById('foo'); +for (var i = 0; i < foo.children.length; i++) { + console.log(foo.children[i].tagName); +} +</pre> + +<h2 id="Polyfill">Polyfill</h2> + +<pre class="brush: js">// Sobrescribe el prototipo 'children' nativo. +// Añade soporte para Document y DocumentFragment en IE9 y Safari. +// Devuelve un array en lugar de HTMLCollection. +;(function(constructor) { + if (constructor && + constructor.prototype && + constructor.prototype.children == null) { + Object.defineProperty(constructor.prototype, 'children', { + get: function() { + var i = 0, node, nodes = this.childNodes, children = []; + while (node = nodes[i++]) { + if (node.nodeType === 1) { + children.push(node); + } + } + return children; + } + }); + } +})(window.Node || window.Element); +</pre> + +<h2 id="Especificación">Especificación</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Especificación</th> + <th scope="col">Estado</th> + <th scope="col">Observaciones</th> + </tr> + <tr> + <td>{{SpecName('DOM WHATWG', '#dom-parentnode-children', 'ParentNode.children')}}</td> + <td>{{Spec2('DOM WHATWG')}}</td> + <td>Definición Inicial</td> + </tr> + </tbody> +</table> + +<h2 id="Compatibilidad_con_navegadores">Compatibilidad con navegadores</h2> + +<p>{{ CompatibilityTable() }}</p> + +<div id="compat-desktop"> +<table class="compat-table"> + <tbody> + <tr> + <th>Característica</th> + <th>Chrome</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Edge</th> + <th>Opera</th> + <th>Safari</th> + </tr> + <tr> + <td>Soporte básico (en {{domxref("Element")}})</td> + <td>1.0</td> + <td>{{CompatGeckoDesktop("1.9.1")}}</td> + <td>9.0 [1]</td> + <td>38.0</td> + <td>10.0</td> + <td>4.0</td> + </tr> + <tr> + <td>Soporte en {{domxref("Document")}} y {{domxref("DocumentFragment")}} {{experimental_inline}}</td> + <td>29.0</td> + <td>{{CompatGeckoDesktop("25.0")}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>16.0</td> + <td>{{CompatNo}}</td> + </tr> + <tr> + <td>Soporte en {{domxref("SVGElement")}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> + +<div id="compat-mobile"> +<table class="compat-table"> + <tbody> + <tr> + <th>Característica</th> + <th>Android</th> + <th>Firefox Mobile (Gecko)</th> + <th>IE Mobile</th> + <th>Opera Mobile</th> + <th>Safari Mobile</th> + </tr> + <tr> + <td>Soporte básico (en {{domxref("Element")}})</td> + <td>{{ CompatVersionUnknown() }}</td> + <td>{{CompatGeckoMobile("1.9.1")}}</td> + <td>{{ CompatVersionUnknown() }}</td> + <td>{{ CompatVersionUnknown() }}</td> + <td>{{ CompatVersionUnknown() }}</td> + </tr> + <tr> + <td>Soporte básico {{domxref("Document")}} y {{domxref("DocumentFragment")}} {{experimental_inline}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatGeckoMobile("25.0")}}</td> + <td>{{CompatNo}}</td> + <td>16.0</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> + +<p>[1] Internet Explorer 6, 7 y 8 lo soportan, pero incluyen nodos {{domxref("Comment")}} de manera errónea.</p> + +<h2 id="Ver_también">Ver también</h2> + +<ul> + <li>Las interfaces {{domxref("ParentNode")}} y {{domxref("ChildNode")}}.</li> + <li> + <div class="syntaxbox">Tipos e objetos que implementan este interfaz: {{domxref("Document")}}, {{domxref("Element")}}, y {{domxref("DocumentFragment")}}.</div> + </li> +</ul> diff --git a/files/es/web/api/parentnode/children/index.html b/files/es/web/api/parentnode/children/index.html deleted file mode 100644 index 8a9071830c..0000000000 --- a/files/es/web/api/parentnode/children/index.html +++ /dev/null @@ -1,157 +0,0 @@ ---- -title: ParentNode.children -slug: Web/API/ParentNode/children -tags: - - API - - DOM - - ParentNode - - Propiedad -translation_of: Web/API/ParentNode/children ---- -<p>{{ APIRef("DOM") }}</p> - -<p><code><strong>Node.children</strong></code> es una propiedad de sólo lectura que retorna una {{domxref("HTMLCollection")}} "viva" de los elementos hijos de un <code>Node</code>.</p> - -<h2 id="Sintaxis">Sintaxis</h2> - -<pre class="syntaxbox">var <em>children</em> = <em>node</em>.children; </pre> - -<p><code><var>children</var></code> es una {{ domxref("HTMLCollection") }}, que es una colección ordenada de los elementos DOM que son hijos <code>de <em>node</em></code>. Si no hay elementos hijos, entonces <code><var>children</var></code> no contendrá elementos y su longitud ( <code>length</code> ) será <code>0</code>.</p> - -<h2 id="Ejemplo">Ejemplo</h2> - -<pre class="brush: js">var foo = document.getElementById('foo'); -for (var i = 0; i < foo.children.length; i++) { - console.log(foo.children[i].tagName); -} -</pre> - -<h2 id="Polyfill">Polyfill</h2> - -<pre class="brush: js">// Sobrescribe el prototipo 'children' nativo. -// Añade soporte para Document y DocumentFragment en IE9 y Safari. -// Devuelve un array en lugar de HTMLCollection. -;(function(constructor) { - if (constructor && - constructor.prototype && - constructor.prototype.children == null) { - Object.defineProperty(constructor.prototype, 'children', { - get: function() { - var i = 0, node, nodes = this.childNodes, children = []; - while (node = nodes[i++]) { - if (node.nodeType === 1) { - children.push(node); - } - } - return children; - } - }); - } -})(window.Node || window.Element); -</pre> - -<h2 id="Especificación">Especificación</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Especificación</th> - <th scope="col">Estado</th> - <th scope="col">Observaciones</th> - </tr> - <tr> - <td>{{SpecName('DOM WHATWG', '#dom-parentnode-children', 'ParentNode.children')}}</td> - <td>{{Spec2('DOM WHATWG')}}</td> - <td>Definición Inicial</td> - </tr> - </tbody> -</table> - -<h2 id="Compatibilidad_con_navegadores">Compatibilidad con navegadores</h2> - -<p>{{ CompatibilityTable() }}</p> - -<div id="compat-desktop"> -<table class="compat-table"> - <tbody> - <tr> - <th>Característica</th> - <th>Chrome</th> - <th>Firefox (Gecko)</th> - <th>Internet Explorer</th> - <th>Edge</th> - <th>Opera</th> - <th>Safari</th> - </tr> - <tr> - <td>Soporte básico (en {{domxref("Element")}})</td> - <td>1.0</td> - <td>{{CompatGeckoDesktop("1.9.1")}}</td> - <td>9.0 [1]</td> - <td>38.0</td> - <td>10.0</td> - <td>4.0</td> - </tr> - <tr> - <td>Soporte en {{domxref("Document")}} y {{domxref("DocumentFragment")}} {{experimental_inline}}</td> - <td>29.0</td> - <td>{{CompatGeckoDesktop("25.0")}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>16.0</td> - <td>{{CompatNo}}</td> - </tr> - <tr> - <td>Soporte en {{domxref("SVGElement")}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatUnknown}}</td> - <td>{{CompatNo}}</td> - </tr> - </tbody> -</table> -</div> - -<div id="compat-mobile"> -<table class="compat-table"> - <tbody> - <tr> - <th>Característica</th> - <th>Android</th> - <th>Firefox Mobile (Gecko)</th> - <th>IE Mobile</th> - <th>Opera Mobile</th> - <th>Safari Mobile</th> - </tr> - <tr> - <td>Soporte básico (en {{domxref("Element")}})</td> - <td>{{ CompatVersionUnknown() }}</td> - <td>{{CompatGeckoMobile("1.9.1")}}</td> - <td>{{ CompatVersionUnknown() }}</td> - <td>{{ CompatVersionUnknown() }}</td> - <td>{{ CompatVersionUnknown() }}</td> - </tr> - <tr> - <td>Soporte básico {{domxref("Document")}} y {{domxref("DocumentFragment")}} {{experimental_inline}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatGeckoMobile("25.0")}}</td> - <td>{{CompatNo}}</td> - <td>16.0</td> - <td>{{CompatNo}}</td> - </tr> - </tbody> -</table> -</div> - -<p>[1] Internet Explorer 6, 7 y 8 lo soportan, pero incluyen nodos {{domxref("Comment")}} de manera errónea.</p> - -<h2 id="Ver_también">Ver también</h2> - -<ul> - <li>Las interfaces {{domxref("ParentNode")}} y {{domxref("ChildNode")}}.</li> - <li> - <div class="syntaxbox">Tipos e objetos que implementan este interfaz: {{domxref("Document")}}, {{domxref("Element")}}, y {{domxref("DocumentFragment")}}.</div> - </li> -</ul> diff --git a/files/fr/_redirects.txt b/files/fr/_redirects.txt index f956671d39..08f6d17707 100644 --- a/files/fr/_redirects.txt +++ b/files/fr/_redirects.txt @@ -3800,6 +3800,7 @@ /fr/docs/Web/API/Node/prefix /fr/docs/conflicting/Web/API/Element/prefix /fr/docs/Web/API/Node/rootNode /fr/docs/conflicting/Web/API/Node/getRootNode /fr/docs/Web/API/ParentNode/childElementCount /fr/docs/Web/API/Element/childElementCount +/fr/docs/Web/API/ParentNode/children /fr/docs/orphaned/Web/API/ParentNode/children /fr/docs/Web/API/PasswordCredential/additionalData /fr/docs/conflicting/Web/API/PasswordCredential /fr/docs/Web/API/PasswordCredential/idName /fr/docs/conflicting/Web/API/PasswordCredential_cbf7b306e83a3f58ff06bccf89637c12 /fr/docs/Web/API/PasswordCredential/passwordName /fr/docs/conflicting/Web/API/PasswordCredential_bc57d5dfa87242b4fb83497887124f41 diff --git a/files/fr/_wikihistory.json b/files/fr/_wikihistory.json index c66afaeeff..7691f6cf76 100644 --- a/files/fr/_wikihistory.json +++ b/files/fr/_wikihistory.json @@ -11700,16 +11700,6 @@ "ayshiff" ] }, - "Web/API/ParentNode/children": { - "modified": "2020-10-15T21:43:07.206Z", - "contributors": [ - "Arzak656", - "jMoulis", - "loella16", - "NemoNobobyPersonne", - "xavierartot" - ] - }, "Web/API/ParentNode/firstElementChild": { "modified": "2019-03-23T23:35:50.443Z", "contributors": [ @@ -45335,5 +45325,15 @@ "xavierartot", "vava" ] + }, + "orphaned/Web/API/ParentNode/children": { + "modified": "2020-10-15T21:43:07.206Z", + "contributors": [ + "Arzak656", + "jMoulis", + "loella16", + "NemoNobobyPersonne", + "xavierartot" + ] } } \ No newline at end of file diff --git a/files/fr/orphaned/web/api/parentnode/children/index.html b/files/fr/orphaned/web/api/parentnode/children/index.html new file mode 100644 index 0000000000..7fed7973ec --- /dev/null +++ b/files/fr/orphaned/web/api/parentnode/children/index.html @@ -0,0 +1,90 @@ +--- +title: ParentNode.children +slug: orphaned/Web/API/ParentNode/children +tags: + - API + - DOM + - Noeuds + - Propriétés + - parent +translation_of: Web/API/ParentNode/children +original_slug: Web/API/ParentNode/children +--- +<p>{{ APIRef("DOM") }}</p> + +<p>La propriété <code><strong>children</strong></code> de {{domxref("ParentNode")}} est une propriété en lecture seule qui renvoie une {{domxref("HTMLCollection")}} directe contenant tous les enfants {{domxref("Element","éléments")}} du noeud sur lequel elle a été appelée.</p> + +<h2 id="Syntaxe">Syntaxe</h2> + +<pre class="syntaxbox">var <em>children</em> = <em>node</em>.children;</pre> + +<h3 id="Valeur">Valeur</h3> + +<p>Une {{ domxref("HTMLCollection") }}, qui est une collection directe et ordonnée des éléments DOM qui sont enfants du <em><code>node</code></em> (<em>noeud</em>). Vous pouvez accéder aux noeuds enfants individuellement en utilisant la méthode {{domxref("HTMLCollection.item", "item()")}} (<em>élément</em>) sur la collection ou en utilisant la notation de type tableau (<em>array</em>) de JavaScript.</p> + +<p>S'il n'y a pas d'éléments enfants, alors <code>children</code> est une liste vide et a une <code>length</code> (<em>longueur</em>) de <code>0</code>.</p> + +<h2 id="Exemple">Exemple</h2> + +<pre class="brush: js line-numbers language-js"><code class="language-js"><span class="keyword token">var</span> machin <span class="operator token">=</span> document<span class="punctuation token">.</span><span class="function token">getElementById</span><span class="punctuation token">(</span><span class="string token">'machin'</span><span class="punctuation token">)</span><span class="punctuation token">;</span> +<span class="keyword token">for</span> <span class="punctuation token">(</span><span class="keyword token">var</span> i <span class="operator token">=</span> <span class="number token">0</span><span class="punctuation token">;</span> i <span class="operator token"><</span> machin<span class="punctuation token">.</span>children<span class="punctuation token">.</span>length<span class="punctuation token">;</span> i<span class="operator token">++</span><span class="punctuation token">)</span> <span class="punctuation token">{</span> + console<span class="punctuation token">.</span><span class="function token">log</span><span class="punctuation token">(</span>machin<span class="punctuation token">.</span>children<span class="punctuation token">[</span>i<span class="punctuation token">]</span><span class="punctuation token">.</span>tagName<span class="punctuation token">)</span><span class="punctuation token">;</span> +<span class="punctuation token">}</span></code></pre> + +<h2 id="Polyfill">Polyfill</h2> + +<pre class="brush: js line-numbers language-js"><code class="language-js"><span class="comment token">// Réécrit le prototype 'children' natif.</span> +<span class="comment token">// Ajoute le support de Document & DocumentFragment pour IE9 & Safari.</span> +<span class="comment token">// Renvoie un tableau (<em>array</em>) au lieu d'une HTMLCollection.</span> +<span class="punctuation token">;</span><span class="punctuation token">(</span><span class="keyword token">function</span><span class="punctuation token">(</span>constructeur<span class="punctuation token">)</span> <span class="punctuation token">{</span> + <span class="keyword token">if</span> <span class="punctuation token">(</span>constructeur <span class="operator token">&&</span> + constructeur<span class="punctuation token">.</span>prototype <span class="operator token">&&</span> + constructeur<span class="punctuation token">.</span>prototype<span class="punctuation token">.</span>children <span class="operator token">==</span> <span class="keyword token">null</span><span class="punctuation token">)</span> <span class="punctuation token">{</span> + Object<span class="punctuation token">.</span><span class="function token">defineProperty</span><span class="punctuation token">(</span>constructeur<span class="punctuation token">.</span>prototype<span class="punctuation token">,</span> <span class="string token">'children'</span><span class="punctuation token">,</span> <span class="punctuation token">{</span> + <span class="keyword token">get</span><span class="punctuation token">:</span> <span class="keyword token">function</span><span class="punctuation token">(</span><span class="punctuation token">)</span> <span class="punctuation token">{</span> + <span class="keyword token">var</span> i <span class="operator token">=</span> <span class="number token">0</span><span class="punctuation token">,</span> noeud<span class="punctuation token">,</span> noeuds <span class="operator token">=</span> <span class="keyword token">this</span><span class="punctuation token">.</span>childNodes<span class="punctuation token">,</span> children <span class="operator token">=</span> <span class="punctuation token">[</span><span class="punctuation token">]</span><span class="punctuation token">;</span> + <span class="keyword token">while</span> <span class="punctuation token">(</span>noeud <span class="operator token">=</span> noeuds<span class="punctuation token">[</span>i<span class="operator token">++</span><span class="punctuation token">]</span><span class="punctuation token">)</span> <span class="punctuation token">{</span> + <span class="keyword token">if</span> <span class="punctuation token">(</span>noeud<span class="punctuation token">.</span>nodeType <span class="operator token">===</span> <span class="number token">1</span><span class="punctuation token">)</span> <span class="punctuation token">{</span> + children<span class="punctuation token">.</span><span class="function token">push</span><span class="punctuation token">(</span>noeud<span class="punctuation token">)</span><span class="punctuation token">;</span> + <span class="punctuation token">}</span> + <span class="punctuation token">}</span> + <span class="keyword token">return</span> children<span class="punctuation token">;</span> + <span class="punctuation token">}</span> + <span class="punctuation token">}</span><span class="punctuation token">)</span><span class="punctuation token">;</span> + <span class="punctuation token">}</span> +<span class="punctuation token">}</span><span class="punctuation token">)</span><span class="punctuation token">(</span>window<span class="punctuation token">.</span>Node <span class="operator token">||</span> window<span class="punctuation token">.</span>Element<span class="punctuation token">)</span><span class="punctuation token">;</span></code></pre> + +<h2 id="Spécification">Spécification</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Spécification</th> + <th scope="col">Statut</th> + <th scope="col">Commentaire</th> + </tr> + <tr> + <td>{{SpecName('DOM WHATWG', '#dom-parentnode-children', 'ParentNode.children')}}</td> + <td>{{Spec2('DOM WHATWG')}}</td> + <td>Définition initiale.</td> + </tr> + </tbody> +</table> + +<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2> + + + +<p>{{Compat("api.ParentNode.children")}}</p> + +<h2 id="Voir_aussi">Voir aussi</h2> + +<ul> + <li>Les interfaces {{domxref("ParentNode")}} et{{domxref("ChildNode")}}.</li> + <li> + <div class="syntaxbox">Les types d'objets implémentant cette interface : {{domxref("Document")}}, {{domxref("Element")}} et {{domxref("DocumentFragment")}}.</div> + </li> + <li> + <div class="syntaxbox">{{domxref("Node.childNodes")}}</div> + </li> +</ul> diff --git a/files/fr/web/api/parentnode/children/index.html b/files/fr/web/api/parentnode/children/index.html deleted file mode 100644 index 52c529a1b8..0000000000 --- a/files/fr/web/api/parentnode/children/index.html +++ /dev/null @@ -1,89 +0,0 @@ ---- -title: ParentNode.children -slug: Web/API/ParentNode/children -tags: - - API - - DOM - - Noeuds - - Propriétés - - parent -translation_of: Web/API/ParentNode/children ---- -<p>{{ APIRef("DOM") }}</p> - -<p>La propriété <code><strong>children</strong></code> de {{domxref("ParentNode")}} est une propriété en lecture seule qui renvoie une {{domxref("HTMLCollection")}} directe contenant tous les enfants {{domxref("Element","éléments")}} du noeud sur lequel elle a été appelée.</p> - -<h2 id="Syntaxe">Syntaxe</h2> - -<pre class="syntaxbox">var <em>children</em> = <em>node</em>.children;</pre> - -<h3 id="Valeur">Valeur</h3> - -<p>Une {{ domxref("HTMLCollection") }}, qui est une collection directe et ordonnée des éléments DOM qui sont enfants du <em><code>node</code></em> (<em>noeud</em>). Vous pouvez accéder aux noeuds enfants individuellement en utilisant la méthode {{domxref("HTMLCollection.item", "item()")}} (<em>élément</em>) sur la collection ou en utilisant la notation de type tableau (<em>array</em>) de JavaScript.</p> - -<p>S'il n'y a pas d'éléments enfants, alors <code>children</code> est une liste vide et a une <code>length</code> (<em>longueur</em>) de <code>0</code>.</p> - -<h2 id="Exemple">Exemple</h2> - -<pre class="brush: js line-numbers language-js"><code class="language-js"><span class="keyword token">var</span> machin <span class="operator token">=</span> document<span class="punctuation token">.</span><span class="function token">getElementById</span><span class="punctuation token">(</span><span class="string token">'machin'</span><span class="punctuation token">)</span><span class="punctuation token">;</span> -<span class="keyword token">for</span> <span class="punctuation token">(</span><span class="keyword token">var</span> i <span class="operator token">=</span> <span class="number token">0</span><span class="punctuation token">;</span> i <span class="operator token"><</span> machin<span class="punctuation token">.</span>children<span class="punctuation token">.</span>length<span class="punctuation token">;</span> i<span class="operator token">++</span><span class="punctuation token">)</span> <span class="punctuation token">{</span> - console<span class="punctuation token">.</span><span class="function token">log</span><span class="punctuation token">(</span>machin<span class="punctuation token">.</span>children<span class="punctuation token">[</span>i<span class="punctuation token">]</span><span class="punctuation token">.</span>tagName<span class="punctuation token">)</span><span class="punctuation token">;</span> -<span class="punctuation token">}</span></code></pre> - -<h2 id="Polyfill">Polyfill</h2> - -<pre class="brush: js line-numbers language-js"><code class="language-js"><span class="comment token">// Réécrit le prototype 'children' natif.</span> -<span class="comment token">// Ajoute le support de Document & DocumentFragment pour IE9 & Safari.</span> -<span class="comment token">// Renvoie un tableau (<em>array</em>) au lieu d'une HTMLCollection.</span> -<span class="punctuation token">;</span><span class="punctuation token">(</span><span class="keyword token">function</span><span class="punctuation token">(</span>constructeur<span class="punctuation token">)</span> <span class="punctuation token">{</span> - <span class="keyword token">if</span> <span class="punctuation token">(</span>constructeur <span class="operator token">&&</span> - constructeur<span class="punctuation token">.</span>prototype <span class="operator token">&&</span> - constructeur<span class="punctuation token">.</span>prototype<span class="punctuation token">.</span>children <span class="operator token">==</span> <span class="keyword token">null</span><span class="punctuation token">)</span> <span class="punctuation token">{</span> - Object<span class="punctuation token">.</span><span class="function token">defineProperty</span><span class="punctuation token">(</span>constructeur<span class="punctuation token">.</span>prototype<span class="punctuation token">,</span> <span class="string token">'children'</span><span class="punctuation token">,</span> <span class="punctuation token">{</span> - <span class="keyword token">get</span><span class="punctuation token">:</span> <span class="keyword token">function</span><span class="punctuation token">(</span><span class="punctuation token">)</span> <span class="punctuation token">{</span> - <span class="keyword token">var</span> i <span class="operator token">=</span> <span class="number token">0</span><span class="punctuation token">,</span> noeud<span class="punctuation token">,</span> noeuds <span class="operator token">=</span> <span class="keyword token">this</span><span class="punctuation token">.</span>childNodes<span class="punctuation token">,</span> children <span class="operator token">=</span> <span class="punctuation token">[</span><span class="punctuation token">]</span><span class="punctuation token">;</span> - <span class="keyword token">while</span> <span class="punctuation token">(</span>noeud <span class="operator token">=</span> noeuds<span class="punctuation token">[</span>i<span class="operator token">++</span><span class="punctuation token">]</span><span class="punctuation token">)</span> <span class="punctuation token">{</span> - <span class="keyword token">if</span> <span class="punctuation token">(</span>noeud<span class="punctuation token">.</span>nodeType <span class="operator token">===</span> <span class="number token">1</span><span class="punctuation token">)</span> <span class="punctuation token">{</span> - children<span class="punctuation token">.</span><span class="function token">push</span><span class="punctuation token">(</span>noeud<span class="punctuation token">)</span><span class="punctuation token">;</span> - <span class="punctuation token">}</span> - <span class="punctuation token">}</span> - <span class="keyword token">return</span> children<span class="punctuation token">;</span> - <span class="punctuation token">}</span> - <span class="punctuation token">}</span><span class="punctuation token">)</span><span class="punctuation token">;</span> - <span class="punctuation token">}</span> -<span class="punctuation token">}</span><span class="punctuation token">)</span><span class="punctuation token">(</span>window<span class="punctuation token">.</span>Node <span class="operator token">||</span> window<span class="punctuation token">.</span>Element<span class="punctuation token">)</span><span class="punctuation token">;</span></code></pre> - -<h2 id="Spécification">Spécification</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Spécification</th> - <th scope="col">Statut</th> - <th scope="col">Commentaire</th> - </tr> - <tr> - <td>{{SpecName('DOM WHATWG', '#dom-parentnode-children', 'ParentNode.children')}}</td> - <td>{{Spec2('DOM WHATWG')}}</td> - <td>Définition initiale.</td> - </tr> - </tbody> -</table> - -<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2> - - - -<p>{{Compat("api.ParentNode.children")}}</p> - -<h2 id="Voir_aussi">Voir aussi</h2> - -<ul> - <li>Les interfaces {{domxref("ParentNode")}} et{{domxref("ChildNode")}}.</li> - <li> - <div class="syntaxbox">Les types d'objets implémentant cette interface : {{domxref("Document")}}, {{domxref("Element")}} et {{domxref("DocumentFragment")}}.</div> - </li> - <li> - <div class="syntaxbox">{{domxref("Node.childNodes")}}</div> - </li> -</ul> diff --git a/files/it/_redirects.txt b/files/it/_redirects.txt index fb151fd05a..4a4e9cfcb4 100644 --- a/files/it/_redirects.txt +++ b/files/it/_redirects.txt @@ -527,6 +527,7 @@ /it/docs/Web/API/Navigator.cookieEnabled /it/docs/Web/API/Navigator/cookieEnabled /it/docs/Web/API/Node/namespaceURI /it/docs/Web/API/Element/namespaceURI /it/docs/Web/API/Node/prefix /it/docs/Web/API/Element/prefix +/it/docs/Web/API/ParentNode/children /it/docs/orphaned/Web/API/ParentNode/children /it/docs/Web/API/Position /it/docs/Web/API/GeolocationPosition /it/docs/Web/API/URLUtils /it/docs/orphaned/Web/API/HTMLHyperlinkElementUtils /it/docs/Web/API/WindowTimers /it/docs/conflicting/Web/API/WindowOrWorkerGlobalScope diff --git a/files/it/_wikihistory.json b/files/it/_wikihistory.json index 786b9a17e4..d79fc797b5 100644 --- a/files/it/_wikihistory.json +++ b/files/it/_wikihistory.json @@ -1643,12 +1643,6 @@ "ExE-Boss" ] }, - "Web/API/ParentNode/children": { - "modified": "2020-10-15T22:13:17.341Z", - "contributors": [ - "IsibisiDev" - ] - }, "Web/API/ParentNode/firstElementChild": { "modified": "2020-10-15T22:17:20.523Z", "contributors": [ @@ -5994,5 +5988,11 @@ "jsx", "Federico" ] + }, + "orphaned/Web/API/ParentNode/children": { + "modified": "2020-10-15T22:13:17.341Z", + "contributors": [ + "IsibisiDev" + ] } } \ No newline at end of file diff --git a/files/it/orphaned/web/api/parentnode/children/index.html b/files/it/orphaned/web/api/parentnode/children/index.html new file mode 100644 index 0000000000..d5df5c6364 --- /dev/null +++ b/files/it/orphaned/web/api/parentnode/children/index.html @@ -0,0 +1,96 @@ +--- +title: ParentNode.children +slug: orphaned/Web/API/ParentNode/children +tags: + - API + - Child + - Child Nodes + - DOM + - HTMLCollection + - Node + - ParentNode + - Proprietà + - children +translation_of: Web/API/ParentNode/children +original_slug: Web/API/ParentNode/children +--- +<div>{{ APIRef("DOM") }}</div> + +<p><span class="seoSummary">La proprietà {{domxref("ParentNode")}} <code><strong>children</strong></code><strong> </strong>è una proprietà di sola lettura che restituisce una {{domxref("HTMLCollection")}} dinamica che contiene tutti gli {{domxref("Element","elements")}} figli del nodo su cui è stato chiamato.</span></p> + +<h2 id="Sintassi">Sintassi</h2> + +<pre class="syntaxbox">var <em>children</em> = <em>node</em>.children;</pre> + +<h3 id="Valore">Valore</h3> + +<p>Una {{ domxref("HTMLCollection") }} che è dimanica, raccolta ordinata degli elementi DOM che sono figli di <code>node</code>. È possibile accedere ai singoli nodi figlio nella raccolta utilizzando il metodo {{domxref("HTMLCollection.item", "item()")}} nella collezione o utilizzando la notazione in stile array JavaScript.</p> + +<p>Se il nodo non ha elementi figli, <code>children</code> è una lista vuota con una <code>length</code> di <code>0</code>.</p> + +<h2 id="Esempio">Esempio</h2> + +<pre class="brush: js">var foo = document.getElementById('foo'); +for (var i = 0; i < foo.children.length; i++) { + console.log(foo.children[i].tagName); +} +</pre> + +<h2 id="Polyfill">Polyfill</h2> + +<pre class="brush: js">// Sovrascrive il prototipo nativo di "children". +// Aggiunge il supporto Document e DocumentFragment per IE9 & Safari. +// Restituisce un array invece di una HTMLCollection. +;(function(constructor) { + if (constructor && + constructor.prototype && + constructor.prototype.children == null) { + Object.defineProperty(constructor.prototype, 'children', { + get: function() { + var i = 0, node, nodes = this.childNodes, children = []; + while (node = nodes[i++]) { + if (node.nodeType === 1) { + children.push(node); + } + } + return children; + } + }); + } +})(window.Node || window.Element); +</pre> + +<h2 id="Specifiche">Specifiche</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specifica</th> + <th scope="col">Stato</th> + <th scope="col">Commento</th> + </tr> + <tr> + <td>{{SpecName('DOM WHATWG', '#dom-parentnode-children', 'ParentNode.children')}}</td> + <td>{{Spec2('DOM WHATWG')}}</td> + <td>Definizione iniziale.</td> + </tr> + </tbody> +</table> + +<h2 id="Compatibilità_con_i_browser">Compatibilità con i browser</h2> + + + +<p>{{Compat("api.ParentNode.children")}}</p> + +<h2 id="Vedi_anche">Vedi anche</h2> + +<ul> + <li>Le interfacce {{domxref("ParentNode")}} e {{domxref("ChildNode")}}.</li> + <li> + <div class="syntaxbox">Tipi di oggetti che implementano questa interfaccia: {{domxref("Document")}}, {{domxref("Element")}}, e {{domxref("DocumentFragment")}}.</div> + </li> + <li> + <div class="syntaxbox">{{domxref("Node.childNodes")}}</div> + </li> +</ul> diff --git a/files/it/web/api/parentnode/children/index.html b/files/it/web/api/parentnode/children/index.html deleted file mode 100644 index 7bedb73eed..0000000000 --- a/files/it/web/api/parentnode/children/index.html +++ /dev/null @@ -1,95 +0,0 @@ ---- -title: ParentNode.children -slug: Web/API/ParentNode/children -tags: - - API - - Child - - Child Nodes - - DOM - - HTMLCollection - - Node - - ParentNode - - Proprietà - - children -translation_of: Web/API/ParentNode/children ---- -<div>{{ APIRef("DOM") }}</div> - -<p><span class="seoSummary">La proprietà {{domxref("ParentNode")}} <code><strong>children</strong></code><strong> </strong>è una proprietà di sola lettura che restituisce una {{domxref("HTMLCollection")}} dinamica che contiene tutti gli {{domxref("Element","elements")}} figli del nodo su cui è stato chiamato.</span></p> - -<h2 id="Sintassi">Sintassi</h2> - -<pre class="syntaxbox">var <em>children</em> = <em>node</em>.children;</pre> - -<h3 id="Valore">Valore</h3> - -<p>Una {{ domxref("HTMLCollection") }} che è dimanica, raccolta ordinata degli elementi DOM che sono figli di <code>node</code>. È possibile accedere ai singoli nodi figlio nella raccolta utilizzando il metodo {{domxref("HTMLCollection.item", "item()")}} nella collezione o utilizzando la notazione in stile array JavaScript.</p> - -<p>Se il nodo non ha elementi figli, <code>children</code> è una lista vuota con una <code>length</code> di <code>0</code>.</p> - -<h2 id="Esempio">Esempio</h2> - -<pre class="brush: js">var foo = document.getElementById('foo'); -for (var i = 0; i < foo.children.length; i++) { - console.log(foo.children[i].tagName); -} -</pre> - -<h2 id="Polyfill">Polyfill</h2> - -<pre class="brush: js">// Sovrascrive il prototipo nativo di "children". -// Aggiunge il supporto Document e DocumentFragment per IE9 & Safari. -// Restituisce un array invece di una HTMLCollection. -;(function(constructor) { - if (constructor && - constructor.prototype && - constructor.prototype.children == null) { - Object.defineProperty(constructor.prototype, 'children', { - get: function() { - var i = 0, node, nodes = this.childNodes, children = []; - while (node = nodes[i++]) { - if (node.nodeType === 1) { - children.push(node); - } - } - return children; - } - }); - } -})(window.Node || window.Element); -</pre> - -<h2 id="Specifiche">Specifiche</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Specifica</th> - <th scope="col">Stato</th> - <th scope="col">Commento</th> - </tr> - <tr> - <td>{{SpecName('DOM WHATWG', '#dom-parentnode-children', 'ParentNode.children')}}</td> - <td>{{Spec2('DOM WHATWG')}}</td> - <td>Definizione iniziale.</td> - </tr> - </tbody> -</table> - -<h2 id="Compatibilità_con_i_browser">Compatibilità con i browser</h2> - - - -<p>{{Compat("api.ParentNode.children")}}</p> - -<h2 id="Vedi_anche">Vedi anche</h2> - -<ul> - <li>Le interfacce {{domxref("ParentNode")}} e {{domxref("ChildNode")}}.</li> - <li> - <div class="syntaxbox">Tipi di oggetti che implementano questa interfaccia: {{domxref("Document")}}, {{domxref("Element")}}, e {{domxref("DocumentFragment")}}.</div> - </li> - <li> - <div class="syntaxbox">{{domxref("Node.childNodes")}}</div> - </li> -</ul> diff --git a/files/ja/_redirects.txt b/files/ja/_redirects.txt index 8e454ee1ea..44f528c814 100644 --- a/files/ja/_redirects.txt +++ b/files/ja/_redirects.txt @@ -3924,6 +3924,7 @@ /ja/docs/Web/API/NodeList.item /ja/docs/Web/API/NodeList/item /ja/docs/Web/API/NonDocumentTypeChildNode /ja/docs/conflicting/Web/API/Element_861159909c20acebf8e506c3bb0e2f7e /ja/docs/Web/API/ParentNode/childElementCount /ja/docs/Web/API/Element/childElementCount +/ja/docs/Web/API/ParentNode/children /ja/docs/orphaned/Web/API/ParentNode/children /ja/docs/Web/API/Position /ja/docs/Web/API/GeolocationPosition /ja/docs/Web/API/PositionError /ja/docs/Web/API/GeolocationPositionError /ja/docs/Web/API/Push_API/Using_the_Push_API /ja/docs/Web/API/Push_API diff --git a/files/ja/_wikihistory.json b/files/ja/_wikihistory.json index 7a4ab0de94..d0b870246b 100644 --- a/files/ja/_wikihistory.json +++ b/files/ja/_wikihistory.json @@ -19095,13 +19095,6 @@ "isdh" ] }, - "Web/API/ParentNode/children": { - "modified": "2020-11-23T04:45:58.549Z", - "contributors": [ - "segayuu", - "sii" - ] - }, "Web/API/ParentNode/prepend": { "modified": "2020-10-15T22:22:02.876Z", "contributors": [ @@ -53496,5 +53489,12 @@ "yumetodo", "Marsf" ] + }, + "orphaned/Web/API/ParentNode/children": { + "modified": "2020-11-23T04:45:58.549Z", + "contributors": [ + "segayuu", + "sii" + ] } } \ No newline at end of file diff --git a/files/ja/orphaned/web/api/parentnode/children/index.html b/files/ja/orphaned/web/api/parentnode/children/index.html new file mode 100644 index 0000000000..2573bd3621 --- /dev/null +++ b/files/ja/orphaned/web/api/parentnode/children/index.html @@ -0,0 +1,95 @@ +--- +title: ParentNode.children +slug: orphaned/Web/API/ParentNode/children +tags: + - API + - Child + - Child Nodes + - DOM + - HTMLCollection + - Node + - ParentNode + - Property + - children +translation_of: Web/API/ParentNode/children +original_slug: Web/API/ParentNode/children +--- +<div>{{ APIRef("DOM") }}</div> + +<p>{{domxref("ParentNode")}} の <strong><code>children</code></strong> プロパティは、呼び出された際のノードの子{{domxref("Element", "要素", "", 1)}}ノードをすべて含んだ動的な(生きている) {{domxref("HTMLCollection")}} を返す、読み取り専用プロパティです。</p> + +<h2 id="Syntax" name="Syntax">構文</h2> + +<pre class="syntaxbox notranslate">let <em>children</em> = <var>node</var>.children;</pre> + +<h3 id="Value" name="Value">値</h3> + +<p><em><code>node</code></em> の子の DOM要素の生きている順序付きコレクションの、 {{ domxref("HTMLCollection") }} です。コレクションの {{domxref("HTMLCollection.item()", "item()")}} メソッドか、JavaScript の配列スタイルの記法を使って、コレクション内の個々の子ノードにアクセスすることができます。</p> + +<p>ノードが子要素を持たない場合、 <code>children</code> は要素を含まず、<code>length</code> は <code>0</code> です。</p> + +<h2 id="Example" name="Example">例 </h2> + +<pre class="brush: js notranslate">const foo = document.getElementById('foo'); +for (let i = 0; i < foo.children.length; i++) { + console.log(foo.children[i].tagName); +}</pre> + +<h2 id="Polyfill" name="Polyfill">Polyfill</h2> + +<pre class="brush: js notranslate">// Overwrites native 'children' prototype. +// Adds Document & DocumentFragment support for IE9 & Safari. +// Returns array instead of HTMLCollection. +;(function(constructor) { + if (constructor && + constructor.prototype && + constructor.prototype.children == null) { + Object.defineProperty(constructor.prototype, 'children', { + get: function() { + let i = 0, node, nodes = this.childNodes, children = []; + while (node = nodes[i++]) { + if (node.nodeType === 1) { + children.push(node); + } + } + return children; + } + }); + } +})(window.Node || window.Element); +</pre> + +<h2 id="Specification" name="Specification">仕様</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">仕様</th> + <th scope="col">状態</th> + <th scope="col">コメント</th> + </tr> + <tr> + <td>{{SpecName('DOM WHATWG', '#dom-parentnode-children', 'ParentNode.children')}}</td> + <td>{{Spec2('DOM WHATWG')}}</td> + <td>初めての定義</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザー実装状況</h2> + +<div class="hidden">このページの互換表は構造化データで生成されました。このデータに貢献したい方は、<a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックし、プルリクエストを送信してください。</div> + +<p>{{Compat("api.ParentNode.children")}}</p> + +<h2 id="See_also" name="See_also">関連情報</h2> + +<ul> + <li>{{domxref("ParentNode")}} および {{domxref("ChildNode")}} インターフェイス</li> + <li> + <div class="syntaxbox">このインターフェイスを実装する次のオブジェクトタイプ。{{domxref("Document")}}、{{domxref("Element")}}、 および {{domxref("DocumentFragment")}}</div> + </li> + <li> + <div class="syntaxbox">{{domxref("Node.childNodes")}}</div> + </li> +</ul> diff --git a/files/ja/web/api/parentnode/children/index.html b/files/ja/web/api/parentnode/children/index.html deleted file mode 100644 index e451a81b69..0000000000 --- a/files/ja/web/api/parentnode/children/index.html +++ /dev/null @@ -1,94 +0,0 @@ ---- -title: ParentNode.children -slug: Web/API/ParentNode/children -tags: - - API - - Child - - Child Nodes - - DOM - - HTMLCollection - - Node - - ParentNode - - Property - - children -translation_of: Web/API/ParentNode/children ---- -<div>{{ APIRef("DOM") }}</div> - -<p>{{domxref("ParentNode")}} の <strong><code>children</code></strong> プロパティは、呼び出された際のノードの子{{domxref("Element", "要素", "", 1)}}ノードをすべて含んだ動的な(生きている) {{domxref("HTMLCollection")}} を返す、読み取り専用プロパティです。</p> - -<h2 id="Syntax" name="Syntax">構文</h2> - -<pre class="syntaxbox notranslate">let <em>children</em> = <var>node</var>.children;</pre> - -<h3 id="Value" name="Value">値</h3> - -<p><em><code>node</code></em> の子の DOM要素の生きている順序付きコレクションの、 {{ domxref("HTMLCollection") }} です。コレクションの {{domxref("HTMLCollection.item()", "item()")}} メソッドか、JavaScript の配列スタイルの記法を使って、コレクション内の個々の子ノードにアクセスすることができます。</p> - -<p>ノードが子要素を持たない場合、 <code>children</code> は要素を含まず、<code>length</code> は <code>0</code> です。</p> - -<h2 id="Example" name="Example">例 </h2> - -<pre class="brush: js notranslate">const foo = document.getElementById('foo'); -for (let i = 0; i < foo.children.length; i++) { - console.log(foo.children[i].tagName); -}</pre> - -<h2 id="Polyfill" name="Polyfill">Polyfill</h2> - -<pre class="brush: js notranslate">// Overwrites native 'children' prototype. -// Adds Document & DocumentFragment support for IE9 & Safari. -// Returns array instead of HTMLCollection. -;(function(constructor) { - if (constructor && - constructor.prototype && - constructor.prototype.children == null) { - Object.defineProperty(constructor.prototype, 'children', { - get: function() { - let i = 0, node, nodes = this.childNodes, children = []; - while (node = nodes[i++]) { - if (node.nodeType === 1) { - children.push(node); - } - } - return children; - } - }); - } -})(window.Node || window.Element); -</pre> - -<h2 id="Specification" name="Specification">仕様</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">仕様</th> - <th scope="col">状態</th> - <th scope="col">コメント</th> - </tr> - <tr> - <td>{{SpecName('DOM WHATWG', '#dom-parentnode-children', 'ParentNode.children')}}</td> - <td>{{Spec2('DOM WHATWG')}}</td> - <td>初めての定義</td> - </tr> - </tbody> -</table> - -<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザー実装状況</h2> - -<div class="hidden">このページの互換表は構造化データで生成されました。このデータに貢献したい方は、<a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックし、プルリクエストを送信してください。</div> - -<p>{{Compat("api.ParentNode.children")}}</p> - -<h2 id="See_also" name="See_also">関連情報</h2> - -<ul> - <li>{{domxref("ParentNode")}} および {{domxref("ChildNode")}} インターフェイス</li> - <li> - <div class="syntaxbox">このインターフェイスを実装する次のオブジェクトタイプ。{{domxref("Document")}}、{{domxref("Element")}}、 および {{domxref("DocumentFragment")}}</div> - </li> - <li> - <div class="syntaxbox">{{domxref("Node.childNodes")}}</div> - </li> -</ul> diff --git a/files/ko/_redirects.txt b/files/ko/_redirects.txt index c3d8339b2d..75f135b7b3 100644 --- a/files/ko/_redirects.txt +++ b/files/ko/_redirects.txt @@ -661,6 +661,7 @@ /ko/docs/Web/API/Node/innerText /ko/docs/Web/API/HTMLElement/innerText /ko/docs/Web/API/Notification.permission /ko/docs/Web/API/Notification/permission /ko/docs/Web/API/ParentNode/childElementCount /ko/docs/Web/API/Element/childElementCount +/ko/docs/Web/API/ParentNode/children /ko/docs/orphaned/Web/API/ParentNode/children /ko/docs/Web/API/Position /ko/docs/Web/API/GeolocationPosition /ko/docs/Web/API/RandomSource /ko/docs/Web/API/Crypto/getRandomValues /ko/docs/Web/API/RandomSource/getRandomValues /ko/docs/Web/API/Crypto/getRandomValues diff --git a/files/ko/_wikihistory.json b/files/ko/_wikihistory.json index 499ebbef7b..7e84e41438 100644 --- a/files/ko/_wikihistory.json +++ b/files/ko/_wikihistory.json @@ -5183,12 +5183,6 @@ "ChanMyeong" ] }, - "Web/API/ParentNode/children": { - "modified": "2020-10-15T22:08:09.823Z", - "contributors": [ - "whdckszxxx" - ] - }, "Web/API/ParentNode/prepend": { "modified": "2020-10-15T22:19:18.906Z", "contributors": [ @@ -18704,5 +18698,11 @@ "contributors": [ "zzoPark" ] + }, + "orphaned/Web/API/ParentNode/children": { + "modified": "2020-10-15T22:08:09.823Z", + "contributors": [ + "whdckszxxx" + ] } } \ No newline at end of file diff --git a/files/ko/orphaned/web/api/parentnode/children/index.html b/files/ko/orphaned/web/api/parentnode/children/index.html new file mode 100644 index 0000000000..71dd79c408 --- /dev/null +++ b/files/ko/orphaned/web/api/parentnode/children/index.html @@ -0,0 +1,86 @@ +--- +title: ParentNode.children +slug: orphaned/Web/API/ParentNode/children +translation_of: Web/API/ParentNode/children +original_slug: Web/API/ParentNode/children +--- +<div>{{ APIRef("DOM") }}</div> + +<p><span class="seoSummary">{{domxref("ParentNode")}}의 속성 <code><strong>children</strong></code>은 호출된 요소의 모든 자식 노드의 {{domxref("Element","elements")}}를 담고있는 실시간 {{domxref("HTMLCollection")}}을 반환합니다.</span></p> + +<h2 id="Syntax">Syntax </h2> + +<pre class="syntaxbox">var <em>children</em> = <em>node</em>.children;</pre> + +<h3 id="Value">Value</h3> + +<p>실시간이며, <code>node</code>의 자식 DOM 요소들의 정렬된 컬렉션인 {{ domxref("HTMLCollection") }}. 각 자식 요소를 컬렉션 안에서 접근하기 위해서 {{domxref("HTMLCollection.item", "item()")}} 메소드를 이용하거나 Javascript 배열 스타일의 문법을 사용할 수 있습니다.</p> + +<p>만약 노드가 자식요소를 갖고 있지 않나면, <code>children</code>은 0의 <code>length</code>를 가진 빈 리스트 일 것입니다.</p> + +<h2 id="Example">Example</h2> + +<pre class="brush: js">var foo = document.getElementById('foo'); +for (var i = 0; i < foo.children.length; i++) { + console.log(foo.children[i].tagName); +} +</pre> + +<h2 id="Polyfill">Polyfill</h2> + +<pre class="brush: js">// Overwrites native 'children' prototype. +// Adds Document & DocumentFragment support for IE9 & Safari. +// Returns array instead of HTMLCollection. +;(function(constructor) { + if (constructor && + constructor.prototype && + constructor.prototype.children == null) { + Object.defineProperty(constructor.prototype, 'children', { + get: function() { + var i = 0, node, nodes = this.childNodes, children = []; + while (node = nodes[i++]) { + if (node.nodeType === 1) { + children.push(node); + } + } + return children; + } + }); + } +})(window.Node || window.Element); +</pre> + +<h2 id="Specification">Specification</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('DOM WHATWG', '#dom-parentnode-children', 'ParentNode.children')}}</td> + <td>{{Spec2('DOM WHATWG')}}</td> + <td>Initial definition.</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility">Browser compatibility</h2> + + + +<p>{{Compat("api.ParentNode.children")}}</p> + +<h2 id="See_also">See also</h2> + +<ul> + <li>The {{domxref("ParentNode")}} and {{domxref("ChildNode")}} interfaces.</li> + <li> + <div class="syntaxbox">Object types implementing this interface: {{domxref("Document")}}, {{domxref("Element")}}, and {{domxref("DocumentFragment")}}.</div> + </li> + <li> + <div class="syntaxbox">{{domxref("Node.childNodes")}}</div> + </li> +</ul> diff --git a/files/ko/web/api/parentnode/children/index.html b/files/ko/web/api/parentnode/children/index.html deleted file mode 100644 index 264fb25956..0000000000 --- a/files/ko/web/api/parentnode/children/index.html +++ /dev/null @@ -1,85 +0,0 @@ ---- -title: ParentNode.children -slug: Web/API/ParentNode/children -translation_of: Web/API/ParentNode/children ---- -<div>{{ APIRef("DOM") }}</div> - -<p><span class="seoSummary">{{domxref("ParentNode")}}의 속성 <code><strong>children</strong></code>은 호출된 요소의 모든 자식 노드의 {{domxref("Element","elements")}}를 담고있는 실시간 {{domxref("HTMLCollection")}}을 반환합니다.</span></p> - -<h2 id="Syntax">Syntax </h2> - -<pre class="syntaxbox">var <em>children</em> = <em>node</em>.children;</pre> - -<h3 id="Value">Value</h3> - -<p>실시간이며, <code>node</code>의 자식 DOM 요소들의 정렬된 컬렉션인 {{ domxref("HTMLCollection") }}. 각 자식 요소를 컬렉션 안에서 접근하기 위해서 {{domxref("HTMLCollection.item", "item()")}} 메소드를 이용하거나 Javascript 배열 스타일의 문법을 사용할 수 있습니다.</p> - -<p>만약 노드가 자식요소를 갖고 있지 않나면, <code>children</code>은 0의 <code>length</code>를 가진 빈 리스트 일 것입니다.</p> - -<h2 id="Example">Example</h2> - -<pre class="brush: js">var foo = document.getElementById('foo'); -for (var i = 0; i < foo.children.length; i++) { - console.log(foo.children[i].tagName); -} -</pre> - -<h2 id="Polyfill">Polyfill</h2> - -<pre class="brush: js">// Overwrites native 'children' prototype. -// Adds Document & DocumentFragment support for IE9 & Safari. -// Returns array instead of HTMLCollection. -;(function(constructor) { - if (constructor && - constructor.prototype && - constructor.prototype.children == null) { - Object.defineProperty(constructor.prototype, 'children', { - get: function() { - var i = 0, node, nodes = this.childNodes, children = []; - while (node = nodes[i++]) { - if (node.nodeType === 1) { - children.push(node); - } - } - return children; - } - }); - } -})(window.Node || window.Element); -</pre> - -<h2 id="Specification">Specification</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Specification</th> - <th scope="col">Status</th> - <th scope="col">Comment</th> - </tr> - <tr> - <td>{{SpecName('DOM WHATWG', '#dom-parentnode-children', 'ParentNode.children')}}</td> - <td>{{Spec2('DOM WHATWG')}}</td> - <td>Initial definition.</td> - </tr> - </tbody> -</table> - -<h2 id="Browser_compatibility">Browser compatibility</h2> - - - -<p>{{Compat("api.ParentNode.children")}}</p> - -<h2 id="See_also">See also</h2> - -<ul> - <li>The {{domxref("ParentNode")}} and {{domxref("ChildNode")}} interfaces.</li> - <li> - <div class="syntaxbox">Object types implementing this interface: {{domxref("Document")}}, {{domxref("Element")}}, and {{domxref("DocumentFragment")}}.</div> - </li> - <li> - <div class="syntaxbox">{{domxref("Node.childNodes")}}</div> - </li> -</ul> diff --git a/files/pl/_redirects.txt b/files/pl/_redirects.txt index 25b1412960..37438cfa54 100644 --- a/files/pl/_redirects.txt +++ b/files/pl/_redirects.txt @@ -1,3 +1,8 @@ +# DO NOT EDIT THIS FILE MANUALLY. +# Use the CLI instead: +# +# yarn content add-redirect <fromURL> <toURL> +# # FROM-URL TO-URL /pl/docs/AJAX /pl/docs/Web/Guide/AJAX /pl/docs/AJAX/Na_początek /pl/docs/Web/Guide/AJAX/Getting_Started @@ -2006,6 +2011,7 @@ /pl/docs/Web/API/Node/namespaceURI /pl/docs/Web/API/Element/namespaceURI /pl/docs/Web/API/Node/prefix /pl/docs/Web/API/Element/prefix /pl/docs/Web/API/ParentNode/childElementCount /pl/docs/Web/API/Element/childElementCount +/pl/docs/Web/API/ParentNode/children /pl/docs/orphaned/Web/API/ParentNode/children /pl/docs/Web/API/Storage /pl/docs/Web/API/Web_Storage_API /pl/docs/Web/API/Stylesheet /pl/docs/Web/API/CSSStyleSheet /pl/docs/Web/API/Stylesheet/cssRules /pl/docs/Web/API/CSSRuleList diff --git a/files/pl/_wikihistory.json b/files/pl/_wikihistory.json index 1975db680c..fb9326f5e5 100644 --- a/files/pl/_wikihistory.json +++ b/files/pl/_wikihistory.json @@ -2165,12 +2165,6 @@ "Web/API/ParentNode": { "modified": "2020-10-15T22:19:13.921Z" }, - "Web/API/ParentNode/children": { - "modified": "2020-10-29T07:01:42.075Z", - "contributors": [ - "dk333" - ] - }, "Web/API/Push_API": { "modified": "2019-03-23T22:08:29.784Z", "contributors": [ @@ -11745,5 +11739,11 @@ "kaka0204", "SurmaAa" ] + }, + "orphaned/Web/API/ParentNode/children": { + "modified": "2020-10-29T07:01:42.075Z", + "contributors": [ + "dk333" + ] } } \ No newline at end of file diff --git a/files/pl/orphaned/web/api/parentnode/children/index.html b/files/pl/orphaned/web/api/parentnode/children/index.html new file mode 100644 index 0000000000..f7f80ac704 --- /dev/null +++ b/files/pl/orphaned/web/api/parentnode/children/index.html @@ -0,0 +1,97 @@ +--- +title: ParentNode.children +slug: orphaned/Web/API/ParentNode/children +tags: + - API + - Dzieci + - Dziecko + - Kolekcja HTML + - Potomek + - Potomkowie + - Właściwość + - węzeł +translation_of: Web/API/ParentNode/children +original_slug: Web/API/ParentNode/children +--- +<div>{{ APIRef("DOM") }}</div> + +<p><span class="seoSummary">The {{domxref("ParentNode")}} właściwość <code><strong>children</strong></code> jest właściwością tylko do odczytu (read-only) która zwraca aktualną kolekcję {{domxref("HTMLCollection")}} zawierającą wszystkie elementy podrzędne {{domxref("Element", "elements")}} węzła, na którym został wywołany.</span></p> + +<h2 id="Składnia">Składnia</h2> + +<pre class="syntaxbox notranslate">let <var>children</var> = <var>node</var>.children;</pre> + +<h3 id="Value">Value</h3> + +<p>{{ domxref("HTMLCollection") }} aktualna, uporządkowana kolekcja elementów DOM które są potomkami <code><var>node</var></code>. Możesz otrzymać pojedynczych potomków kolekcji używając albo {{domxref("HTMLCollection.item()", "item()")}} metody na kolekcji, albo używając notacji w stylu tablicowym języka JavaScript.</p> + +<p>Jeżeli element node nie ma potomków, wtedy <code>children</code> jest pustą listą o długości 0 (<code>length</code> of <code>0)</code>.</p> + +<h2 id="Przykład">Przykład</h2> + +<pre class="brush: js notranslate">const foo = document.getElementById('foo'); +for (let i = 0; i < foo.children.length; i++) { + console.log(foo.children[i].tagName); +} +</pre> + +<h2 id="Uzupełnienie">Uzupełnienie</h2> + +<pre class="brush: js notranslate">// Nadpisuje natywny prototyp 'children'. +// Dodaje Document & DocumentFragment wsparcie dla IE9 & Safari. +// Zwraca tablicę zamiast HTMLCollection. +;(function(constructor) { + if (constructor && + constructor.prototype && + constructor.prototype.children == null) { + Object.defineProperty(constructor.prototype, 'children', { + get: function() { + let i = 0, node, nodes = this.childNodes, children = []; + while (node = nodes[i++]) { + if (node.nodeType === 1) { + children.push(node); + } + } + return children; + } + }); + } +})(window.Node || window.Element); +</pre> + +<h2 id="Specyfikacja">Specyfikacja</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('DOM WHATWG', '#dom-parentnode-children', 'ParentNode.children')}}</td> + <td>{{Spec2('DOM WHATWG')}}</td> + <td>Wstępna definicja</td> + </tr> + </tbody> +</table> + +<h2 id="Zgodność_z_przeglądarkami">Zgodność z przeglądarkami</h2> + +<div class="hidden">Tablica zgodności na tej stronie jest generowana z danych strukturalnych. Jeśli chcesz przyczynić się do do tych danych, proszę sprawdź <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> i wyślij nam swoją propozycję (a pull request).</div> + +<p>{{Compat("api.ParentNode.children")}}</p> + +<h2 id="Zobacz_także">Zobacz także</h2> + +<ul> + <li>Interfejsy {{domxref("ParentNode")}} {{domxref("ChildNode")}}.</li> + <li> + <div class="syntaxbox">Typy obiektów implementujące ten interfejs: {{domxref("Document")}}, {{domxref("Element")}}, {{domxref("DocumentFragment")}}.</div> + </li> + <li> + <div class="syntaxbox">{{domxref("Node.childNodes")}}</div> + </li> +</ul> diff --git a/files/pl/web/api/parentnode/children/index.html b/files/pl/web/api/parentnode/children/index.html deleted file mode 100644 index 1d8576d64b..0000000000 --- a/files/pl/web/api/parentnode/children/index.html +++ /dev/null @@ -1,96 +0,0 @@ ---- -title: ParentNode.children -slug: Web/API/ParentNode/children -tags: - - API - - Dzieci - - Dziecko - - Kolekcja HTML - - Potomek - - Potomkowie - - Właściwość - - węzeł -translation_of: Web/API/ParentNode/children ---- -<div>{{ APIRef("DOM") }}</div> - -<p><span class="seoSummary">The {{domxref("ParentNode")}} właściwość <code><strong>children</strong></code> jest właściwością tylko do odczytu (read-only) która zwraca aktualną kolekcję {{domxref("HTMLCollection")}} zawierającą wszystkie elementy podrzędne {{domxref("Element", "elements")}} węzła, na którym został wywołany.</span></p> - -<h2 id="Składnia">Składnia</h2> - -<pre class="syntaxbox notranslate">let <var>children</var> = <var>node</var>.children;</pre> - -<h3 id="Value">Value</h3> - -<p>{{ domxref("HTMLCollection") }} aktualna, uporządkowana kolekcja elementów DOM które są potomkami <code><var>node</var></code>. Możesz otrzymać pojedynczych potomków kolekcji używając albo {{domxref("HTMLCollection.item()", "item()")}} metody na kolekcji, albo używając notacji w stylu tablicowym języka JavaScript.</p> - -<p>Jeżeli element node nie ma potomków, wtedy <code>children</code> jest pustą listą o długości 0 (<code>length</code> of <code>0)</code>.</p> - -<h2 id="Przykład">Przykład</h2> - -<pre class="brush: js notranslate">const foo = document.getElementById('foo'); -for (let i = 0; i < foo.children.length; i++) { - console.log(foo.children[i].tagName); -} -</pre> - -<h2 id="Uzupełnienie">Uzupełnienie</h2> - -<pre class="brush: js notranslate">// Nadpisuje natywny prototyp 'children'. -// Dodaje Document & DocumentFragment wsparcie dla IE9 & Safari. -// Zwraca tablicę zamiast HTMLCollection. -;(function(constructor) { - if (constructor && - constructor.prototype && - constructor.prototype.children == null) { - Object.defineProperty(constructor.prototype, 'children', { - get: function() { - let i = 0, node, nodes = this.childNodes, children = []; - while (node = nodes[i++]) { - if (node.nodeType === 1) { - children.push(node); - } - } - return children; - } - }); - } -})(window.Node || window.Element); -</pre> - -<h2 id="Specyfikacja">Specyfikacja</h2> - -<table class="standard-table"> - <thead> - <tr> - <th scope="col">Specification</th> - <th scope="col">Status</th> - <th scope="col">Comment</th> - </tr> - </thead> - <tbody> - <tr> - <td>{{SpecName('DOM WHATWG', '#dom-parentnode-children', 'ParentNode.children')}}</td> - <td>{{Spec2('DOM WHATWG')}}</td> - <td>Wstępna definicja</td> - </tr> - </tbody> -</table> - -<h2 id="Zgodność_z_przeglądarkami">Zgodność z przeglądarkami</h2> - -<div class="hidden">Tablica zgodności na tej stronie jest generowana z danych strukturalnych. Jeśli chcesz przyczynić się do do tych danych, proszę sprawdź <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> i wyślij nam swoją propozycję (a pull request).</div> - -<p>{{Compat("api.ParentNode.children")}}</p> - -<h2 id="Zobacz_także">Zobacz także</h2> - -<ul> - <li>Interfejsy {{domxref("ParentNode")}} {{domxref("ChildNode")}}.</li> - <li> - <div class="syntaxbox">Typy obiektów implementujące ten interfejs: {{domxref("Document")}}, {{domxref("Element")}}, {{domxref("DocumentFragment")}}.</div> - </li> - <li> - <div class="syntaxbox">{{domxref("Node.childNodes")}}</div> - </li> -</ul> diff --git a/files/pt-br/_redirects.txt b/files/pt-br/_redirects.txt index 43c76308bd..dc5ef533e0 100644 --- a/files/pt-br/_redirects.txt +++ b/files/pt-br/_redirects.txt @@ -592,6 +592,7 @@ /pt-BR/docs/Web/API/Node/Entendendo_o_uso_do_método_AppendChild-javascript /pt-BR/docs/orphaned/Web/API/Node/Entendendo_o_uso_do_método_AppendChild-javascript /pt-BR/docs/Web/API/Node/innerText /pt-BR/docs/Web/API/HTMLElement/innerText /pt-BR/docs/Web/API/ParentNode/childElementCount /pt-BR/docs/Web/API/Element/childElementCount +/pt-BR/docs/Web/API/ParentNode/children /pt-BR/docs/orphaned/Web/API/ParentNode/children /pt-BR/docs/Web/API/Position /pt-BR/docs/Web/API/GeolocationPosition /pt-BR/docs/Web/API/Position/coords /pt-BR/docs/Web/API/GeolocationPosition/coords /pt-BR/docs/Web/API/PositionError /pt-BR/docs/Web/API/GeolocationPositionError diff --git a/files/pt-br/_wikihistory.json b/files/pt-br/_wikihistory.json index f0db1f7010..dd23a42b41 100644 --- a/files/pt-br/_wikihistory.json +++ b/files/pt-br/_wikihistory.json @@ -3341,12 +3341,6 @@ "jpmedley" ] }, - "Web/API/ParentNode/children": { - "modified": "2019-03-23T22:19:42.340Z", - "contributors": [ - "rafaelcavalcante" - ] - }, "Web/API/ParentNode/querySelector": { "modified": "2020-10-15T22:23:27.840Z", "contributors": [ @@ -17367,5 +17361,11 @@ "contributors": [ "diegolw" ] + }, + "orphaned/Web/API/ParentNode/children": { + "modified": "2019-03-23T22:19:42.340Z", + "contributors": [ + "rafaelcavalcante" + ] } } \ No newline at end of file diff --git a/files/pt-br/orphaned/web/api/parentnode/children/index.html b/files/pt-br/orphaned/web/api/parentnode/children/index.html new file mode 100644 index 0000000000..64c0f40d68 --- /dev/null +++ b/files/pt-br/orphaned/web/api/parentnode/children/index.html @@ -0,0 +1,132 @@ +--- +title: ParentNode.children +slug: orphaned/Web/API/ParentNode/children +translation_of: Web/API/ParentNode/children +original_slug: Web/API/ParentNode/children +--- +<p>{{ APIRef("DOM") }}</p> + +<p><code><strong>Node.children</strong></code> é uma propriedade exclusivamente de leitura que retorna uma coleção {{domxref("HTMLCollection")}} dos elementos filhos do <code>nó</code>.</p> + +<h2 id="Sintaxe">Sintaxe</h2> + +<pre>var <em>elList</em> = elementNodeReference.children; </pre> + +<p><code><var>elList</var></code> é uma {{ domxref("HTMLCollection") }}, que é uma lista ordenada de uma coleção de elementos do DOM que são filhos do <code>elementNodeReference</code>. Se não existir nenhum elemento filho, o <code>elList</code> não terá elemento algum sua propriedade <code>length</code> será 0.</p> + +<h2 id="Exemplo">Exemplo</h2> + +<pre class="brush: js">// pEl é uma referência à um elemento <p> +var elementChildren = pEl.children; +for (var i = 0; i < elementChildren.length; i++) { + console.log(elementChildren[i].tagName); + // NOTE: elementChildren é uma lista viva, adicionar ou remover filhos de pEl + // mudará instantaneamente o valor retornado por elementChildren +} +</pre> + +<h2 id="Especificação">Especificação</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Especificação</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('DOM WHATWG', '#dom-parentnode-children', 'ParentNode.children')}}</td> + <td>{{Spec2('DOM WHATWG')}}</td> + <td>Definição inicial.</td> + </tr> + </tbody> +</table> + +<h2 id="Compatibilidade_de_navegadores">Compatibilidade de navegadores</h2> + +<p>{{ CompatibilityTable() }}</p> + +<div id="compat-desktop"> +<table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Chrome</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Edge</th> + <th>Opera</th> + <th>Safari</th> + </tr> + <tr> + <td>Basic support (on {{domxref("Element")}})</td> + <td>1.0</td> + <td>{{CompatGeckoDesktop("1.9.1")}}</td> + <td>9.0 [1]</td> + <td>38.0</td> + <td>10.0</td> + <td>4.0</td> + </tr> + <tr> + <td>Support on {{domxref("Document")}} and {{domxref("DocumentFragment")}} {{experimental_inline}}</td> + <td>29.0</td> + <td>{{CompatGeckoDesktop("25.0")}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>16.0</td> + <td>{{CompatNo}}</td> + </tr> + <tr> + <td>Support on {{domxref("SVGElement")}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> + +<div id="compat-mobile"> +<table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Android</th> + <th>Firefox Mobile (Gecko)</th> + <th>IE Mobile</th> + <th>Opera Mobile</th> + <th>Safari Mobile</th> + </tr> + <tr> + <td>Basic support (on {{domxref("Element")}})</td> + <td>{{ CompatVersionUnknown() }}</td> + <td>{{CompatGeckoMobile("1.9.1")}}</td> + <td>{{ CompatVersionUnknown() }}</td> + <td>{{ CompatVersionUnknown() }}</td> + <td>{{ CompatVersionUnknown() }}</td> + </tr> + <tr> + <td>Support on {{domxref("Document")}} and {{domxref("DocumentFragment")}} {{experimental_inline}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatGeckoMobile("25.0")}}</td> + <td>{{CompatNo}}</td> + <td>16.0</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> + +<p>[1] Internet Explorer 6, 7 e 8 suportaram esse método, mas erroneamente incluiam nós de {{domxref("Comment")}}.</p> + +<h2 id="See_also">See also</h2> + +<ul> + <li>As interfaces de {{domxref("ParentNode")}} e {{domxref("ChildNode")}}.</li> + <li> + <div class="syntaxbox">Tipos de objetos implementando esta interface: {{domxref("Document")}}, {{domxref("Element")}}, e {{domxref("DocumentFragment")}}.</div> + </li> +</ul> diff --git a/files/pt-br/web/api/parentnode/children/index.html b/files/pt-br/web/api/parentnode/children/index.html deleted file mode 100644 index 755cff62a5..0000000000 --- a/files/pt-br/web/api/parentnode/children/index.html +++ /dev/null @@ -1,131 +0,0 @@ ---- -title: ParentNode.children -slug: Web/API/ParentNode/children -translation_of: Web/API/ParentNode/children ---- -<p>{{ APIRef("DOM") }}</p> - -<p><code><strong>Node.children</strong></code> é uma propriedade exclusivamente de leitura que retorna uma coleção {{domxref("HTMLCollection")}} dos elementos filhos do <code>nó</code>.</p> - -<h2 id="Sintaxe">Sintaxe</h2> - -<pre>var <em>elList</em> = elementNodeReference.children; </pre> - -<p><code><var>elList</var></code> é uma {{ domxref("HTMLCollection") }}, que é uma lista ordenada de uma coleção de elementos do DOM que são filhos do <code>elementNodeReference</code>. Se não existir nenhum elemento filho, o <code>elList</code> não terá elemento algum sua propriedade <code>length</code> será 0.</p> - -<h2 id="Exemplo">Exemplo</h2> - -<pre class="brush: js">// pEl é uma referência à um elemento <p> -var elementChildren = pEl.children; -for (var i = 0; i < elementChildren.length; i++) { - console.log(elementChildren[i].tagName); - // NOTE: elementChildren é uma lista viva, adicionar ou remover filhos de pEl - // mudará instantaneamente o valor retornado por elementChildren -} -</pre> - -<h2 id="Especificação">Especificação</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Especificação</th> - <th scope="col">Status</th> - <th scope="col">Comment</th> - </tr> - <tr> - <td>{{SpecName('DOM WHATWG', '#dom-parentnode-children', 'ParentNode.children')}}</td> - <td>{{Spec2('DOM WHATWG')}}</td> - <td>Definição inicial.</td> - </tr> - </tbody> -</table> - -<h2 id="Compatibilidade_de_navegadores">Compatibilidade de navegadores</h2> - -<p>{{ CompatibilityTable() }}</p> - -<div id="compat-desktop"> -<table class="compat-table"> - <tbody> - <tr> - <th>Feature</th> - <th>Chrome</th> - <th>Firefox (Gecko)</th> - <th>Internet Explorer</th> - <th>Edge</th> - <th>Opera</th> - <th>Safari</th> - </tr> - <tr> - <td>Basic support (on {{domxref("Element")}})</td> - <td>1.0</td> - <td>{{CompatGeckoDesktop("1.9.1")}}</td> - <td>9.0 [1]</td> - <td>38.0</td> - <td>10.0</td> - <td>4.0</td> - </tr> - <tr> - <td>Support on {{domxref("Document")}} and {{domxref("DocumentFragment")}} {{experimental_inline}}</td> - <td>29.0</td> - <td>{{CompatGeckoDesktop("25.0")}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>16.0</td> - <td>{{CompatNo}}</td> - </tr> - <tr> - <td>Support on {{domxref("SVGElement")}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatUnknown}}</td> - <td>{{CompatNo}}</td> - </tr> - </tbody> -</table> -</div> - -<div id="compat-mobile"> -<table class="compat-table"> - <tbody> - <tr> - <th>Feature</th> - <th>Android</th> - <th>Firefox Mobile (Gecko)</th> - <th>IE Mobile</th> - <th>Opera Mobile</th> - <th>Safari Mobile</th> - </tr> - <tr> - <td>Basic support (on {{domxref("Element")}})</td> - <td>{{ CompatVersionUnknown() }}</td> - <td>{{CompatGeckoMobile("1.9.1")}}</td> - <td>{{ CompatVersionUnknown() }}</td> - <td>{{ CompatVersionUnknown() }}</td> - <td>{{ CompatVersionUnknown() }}</td> - </tr> - <tr> - <td>Support on {{domxref("Document")}} and {{domxref("DocumentFragment")}} {{experimental_inline}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatGeckoMobile("25.0")}}</td> - <td>{{CompatNo}}</td> - <td>16.0</td> - <td>{{CompatNo}}</td> - </tr> - </tbody> -</table> -</div> - -<p>[1] Internet Explorer 6, 7 e 8 suportaram esse método, mas erroneamente incluiam nós de {{domxref("Comment")}}.</p> - -<h2 id="See_also">See also</h2> - -<ul> - <li>As interfaces de {{domxref("ParentNode")}} e {{domxref("ChildNode")}}.</li> - <li> - <div class="syntaxbox">Tipos de objetos implementando esta interface: {{domxref("Document")}}, {{domxref("Element")}}, e {{domxref("DocumentFragment")}}.</div> - </li> -</ul> diff --git a/files/ru/_redirects.txt b/files/ru/_redirects.txt index ca9db1d561..1ccfb65842 100644 --- a/files/ru/_redirects.txt +++ b/files/ru/_redirects.txt @@ -454,6 +454,7 @@ /ru/docs/Web/API/NonDocumentTypeChildNode/nextElementSibling /ru/docs/Web/API/Element/nextElementSibling /ru/docs/Web/API/NonDocumentTypeChildNode/previousElementSibling /ru/docs/Web/API/Element/previousElementSibling /ru/docs/Web/API/ParentNode/childElementCount /ru/docs/Web/API/Element/childElementCount +/ru/docs/Web/API/ParentNode/children /ru/docs/orphaned/Web/API/ParentNode/children /ru/docs/Web/API/PositionError /ru/docs/Web/API/GeolocationPositionError /ru/docs/Web/API/Push_API/Using_the_Push_API /ru/docs/conflicting/Web/API/Push_API /ru/docs/Web/API/RandomSource /ru/docs/conflicting/Web/API/Crypto/getRandomValues diff --git a/files/ru/_wikihistory.json b/files/ru/_wikihistory.json index 9f32b07fd5..c6e56b4a6c 100644 --- a/files/ru/_wikihistory.json +++ b/files/ru/_wikihistory.json @@ -6828,16 +6828,6 @@ "madebydima" ] }, - "Web/API/ParentNode/children": { - "modified": "2019-09-25T14:03:42.278Z", - "contributors": [ - "ellizii", - "Yialo", - "RblSb", - "evgkit", - "In4in" - ] - }, "Web/API/ParentNode/firstElementChild": { "modified": "2019-08-28T05:08:54.083Z", "contributors": [ @@ -25988,5 +25978,15 @@ "undgrnd", "nechehin" ] + }, + "orphaned/Web/API/ParentNode/children": { + "modified": "2019-09-25T14:03:42.278Z", + "contributors": [ + "ellizii", + "Yialo", + "RblSb", + "evgkit", + "In4in" + ] } } \ No newline at end of file diff --git a/files/ru/orphaned/web/api/parentnode/children/index.html b/files/ru/orphaned/web/api/parentnode/children/index.html new file mode 100644 index 0000000000..b380d55fde --- /dev/null +++ b/files/ru/orphaned/web/api/parentnode/children/index.html @@ -0,0 +1,144 @@ +--- +title: Node.children +slug: orphaned/Web/API/ParentNode/children +tags: + - API + - DOM + - ParentNode + - Property + - Reference +translation_of: Web/API/ParentNode/children +original_slug: Web/API/ParentNode/children +--- +<p>{{ APIRef("DOM") }}</p> + +<h2 id="Описание">Описание</h2> + +<p>Свойство <span class="seoSummary"><code><strong>children</strong></code> </span> {{domxref("ParentNode")}} является свойством только для чтения, которое возвращает {{domxref("HTMLCollection")}}, содержащее все дочерние {{domxref("Element", "elements")}} узла, на котором он был вызван.</p> + +<h2 id="Синтаксис">Синтаксис</h2> + +<pre class="syntaxbox">var <em>elList</em> = elementNodeReference.children; </pre> + +<p><var>В результате,</var><code><var> <strong>elList</strong> - </var></code><var>живая коллекция, состоящая из дочерних элементов узла</var><code><var> <strong>elementNodeReference</strong></var></code>, и стоит подметить, что если у узла детей нет, она будет пустой. Определить это можно, обратившись к свойству length, которое содержит в себе количество элементов в коллекции.</p> + +<h2 id="Пример">Пример</h2> + +<pre class="brush: js"><ul> + <li>1 пункт</li> + <li>2 пункт</li> +</ul> + +<script type="text/javascript"> + + var elementChildrens = document.querySelector("ul").children; + for (var i=0, child; child=elementChildrens[i]; i++) { + // elementChildrens - коллекция детей списка + // child - последовательно, каждый из элементов elementChildrens + alert(child.innerHTML); + } + +</script> + +</pre> + +<h2 id="Спецификация">Спецификация</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Спецификация</th> + <th scope="col">Статус</th> + <th scope="col">Комментарий</th> + </tr> + <tr> + <td>{{SpecName('DOM WHATWG', '#dom-parentnode-children', 'ParentNode.children')}}</td> + <td>{{Spec2('DOM WHATWG')}}</td> + <td>Начальное определение.</td> + </tr> + </tbody> +</table> + +<h2 id="Поддержка_браузерами">Поддержка браузерами</h2> + +<p>{{ CompatibilityTable() }}</p> + +<div id="compat-desktop"> +<table class="compat-table"> + <tbody> + <tr> + <th>Особенность</th> + <th>Chrome</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Opera</th> + <th>Safari</th> + </tr> + <tr> + <td>Базовая поддержка {{domxref("Element")}}</td> + <td>1.0</td> + <td>{{CompatGeckoDesktop("1.9.1")}}</td> + <td>9.0 [1]</td> + <td>10.0</td> + <td>4.0</td> + </tr> + <tr> + <td> + <p>Поддержка {{domxref("Document")}} и {{domxref("DocumentFragment")}} {{experimental_inline}}</p> + </td> + <td>29.0</td> + <td>{{CompatGeckoDesktop("25.0")}}</td> + <td>{{CompatNo}}</td> + <td>16.0</td> + <td>{{CompatNo}}</td> + </tr> + <tr> + <td>Поддержка {{domxref("SVGElement")}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> + +<div id="compat-mobile"> +<table class="compat-table"> + <tbody> + <tr> + <th>Особенность</th> + <th>Android</th> + <th>Firefox Mobile (Gecko)</th> + <th>IE Mobile</th> + <th>Opera Mobile</th> + <th>Safari Mobile</th> + </tr> + <tr> + <td>Базовая поддержка {{domxref("Element")}}</td> + <td>{{ CompatVersionUnknown() }}</td> + <td>{{CompatGeckoMobile("1.9.1")}}</td> + <td>{{ CompatVersionUnknown() }}</td> + <td>{{ CompatVersionUnknown() }}</td> + <td>{{ CompatVersionUnknown() }}</td> + </tr> + <tr> + <td>Поддержка {{domxref("Document")}} и {{domxref("DocumentFragment")}} {{experimental_inline}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatGeckoMobile("25.0")}}</td> + <td>{{CompatNo}}</td> + <td>16.0</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> + +<p>Internet Explorer 6, 7 и 8 поддерживают данное свойство, но ошибочно включают в коллекцию комментарии ({{domxref("Comment")}}) в HTML-коде.</p> + +<h2 id="Смотрите_также">Смотрите также</h2> + +<ul> + <li>Свойства {{domxref("ParentNode")}} и {{domxref("ChildNode")}}.</li> +</ul> diff --git a/files/ru/web/api/parentnode/children/index.html b/files/ru/web/api/parentnode/children/index.html deleted file mode 100644 index bc61091552..0000000000 --- a/files/ru/web/api/parentnode/children/index.html +++ /dev/null @@ -1,143 +0,0 @@ ---- -title: Node.children -slug: Web/API/ParentNode/children -tags: - - API - - DOM - - ParentNode - - Property - - Reference -translation_of: Web/API/ParentNode/children ---- -<p>{{ APIRef("DOM") }}</p> - -<h2 id="Описание">Описание</h2> - -<p>Свойство <span class="seoSummary"><code><strong>children</strong></code> </span> {{domxref("ParentNode")}} является свойством только для чтения, которое возвращает {{domxref("HTMLCollection")}}, содержащее все дочерние {{domxref("Element", "elements")}} узла, на котором он был вызван.</p> - -<h2 id="Синтаксис">Синтаксис</h2> - -<pre class="syntaxbox">var <em>elList</em> = elementNodeReference.children; </pre> - -<p><var>В результате,</var><code><var> <strong>elList</strong> - </var></code><var>живая коллекция, состоящая из дочерних элементов узла</var><code><var> <strong>elementNodeReference</strong></var></code>, и стоит подметить, что если у узла детей нет, она будет пустой. Определить это можно, обратившись к свойству length, которое содержит в себе количество элементов в коллекции.</p> - -<h2 id="Пример">Пример</h2> - -<pre class="brush: js"><ul> - <li>1 пункт</li> - <li>2 пункт</li> -</ul> - -<script type="text/javascript"> - - var elementChildrens = document.querySelector("ul").children; - for (var i=0, child; child=elementChildrens[i]; i++) { - // elementChildrens - коллекция детей списка - // child - последовательно, каждый из элементов elementChildrens - alert(child.innerHTML); - } - -</script> - -</pre> - -<h2 id="Спецификация">Спецификация</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Спецификация</th> - <th scope="col">Статус</th> - <th scope="col">Комментарий</th> - </tr> - <tr> - <td>{{SpecName('DOM WHATWG', '#dom-parentnode-children', 'ParentNode.children')}}</td> - <td>{{Spec2('DOM WHATWG')}}</td> - <td>Начальное определение.</td> - </tr> - </tbody> -</table> - -<h2 id="Поддержка_браузерами">Поддержка браузерами</h2> - -<p>{{ CompatibilityTable() }}</p> - -<div id="compat-desktop"> -<table class="compat-table"> - <tbody> - <tr> - <th>Особенность</th> - <th>Chrome</th> - <th>Firefox (Gecko)</th> - <th>Internet Explorer</th> - <th>Opera</th> - <th>Safari</th> - </tr> - <tr> - <td>Базовая поддержка {{domxref("Element")}}</td> - <td>1.0</td> - <td>{{CompatGeckoDesktop("1.9.1")}}</td> - <td>9.0 [1]</td> - <td>10.0</td> - <td>4.0</td> - </tr> - <tr> - <td> - <p>Поддержка {{domxref("Document")}} и {{domxref("DocumentFragment")}} {{experimental_inline}}</p> - </td> - <td>29.0</td> - <td>{{CompatGeckoDesktop("25.0")}}</td> - <td>{{CompatNo}}</td> - <td>16.0</td> - <td>{{CompatNo}}</td> - </tr> - <tr> - <td>Поддержка {{domxref("SVGElement")}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatUnknown}}</td> - <td>{{CompatNo}}</td> - </tr> - </tbody> -</table> -</div> - -<div id="compat-mobile"> -<table class="compat-table"> - <tbody> - <tr> - <th>Особенность</th> - <th>Android</th> - <th>Firefox Mobile (Gecko)</th> - <th>IE Mobile</th> - <th>Opera Mobile</th> - <th>Safari Mobile</th> - </tr> - <tr> - <td>Базовая поддержка {{domxref("Element")}}</td> - <td>{{ CompatVersionUnknown() }}</td> - <td>{{CompatGeckoMobile("1.9.1")}}</td> - <td>{{ CompatVersionUnknown() }}</td> - <td>{{ CompatVersionUnknown() }}</td> - <td>{{ CompatVersionUnknown() }}</td> - </tr> - <tr> - <td>Поддержка {{domxref("Document")}} и {{domxref("DocumentFragment")}} {{experimental_inline}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatGeckoMobile("25.0")}}</td> - <td>{{CompatNo}}</td> - <td>16.0</td> - <td>{{CompatNo}}</td> - </tr> - </tbody> -</table> -</div> - -<p>Internet Explorer 6, 7 и 8 поддерживают данное свойство, но ошибочно включают в коллекцию комментарии ({{domxref("Comment")}}) в HTML-коде.</p> - -<h2 id="Смотрите_также">Смотрите также</h2> - -<ul> - <li>Свойства {{domxref("ParentNode")}} и {{domxref("ChildNode")}}.</li> -</ul> diff --git a/files/zh-cn/_redirects.txt b/files/zh-cn/_redirects.txt index c892700c59..e56379facf 100644 --- a/files/zh-cn/_redirects.txt +++ b/files/zh-cn/_redirects.txt @@ -268,7 +268,7 @@ /zh-CN/docs/DOM/DOMString /zh-CN/docs/Web/API/DOMString /zh-CN/docs/DOM/Document.querySelectorAll /zh-CN/docs/Web/API/Document/querySelectorAll /zh-CN/docs/DOM/Document.scripts /zh-CN/docs/Web/API/Document/scripts -/zh-CN/docs/DOM/Element.children /zh-CN/docs/Web/API/ParentNode/children +/zh-CN/docs/DOM/Element.children /zh-CN/docs/orphaned/Web/API/ParentNode/children /zh-CN/docs/DOM/Element.firstElementChild /zh-CN/docs/Web/API/ParentNode/firstElementChild /zh-CN/docs/DOM/Element.lastElementChild /zh-CN/docs/Web/API/ParentNode/lastElementChild /zh-CN/docs/DOM/Element.nextElementSibling /zh-CN/docs/Web/API/Element/nextElementSibling @@ -1725,10 +1725,11 @@ /zh-CN/docs/Web/API/NonDocumentTypeChildNode/previousElementSibling /zh-CN/docs/Web/API/Element/previousElementSibling /zh-CN/docs/Web/API/OfflineAudioContext/complete /zh-CN/docs/Web/API/OfflineAudioContext/complete_event /zh-CN/docs/Web/API/ParentNode.childElementCount /zh-CN/docs/Web/API/Element/childElementCount -/zh-CN/docs/Web/API/ParentNode.children /zh-CN/docs/Web/API/ParentNode/children +/zh-CN/docs/Web/API/ParentNode.children /zh-CN/docs/orphaned/Web/API/ParentNode/children /zh-CN/docs/Web/API/ParentNode.firstElementChild /zh-CN/docs/Web/API/ParentNode/firstElementChild /zh-CN/docs/Web/API/ParentNode.lastElementChild /zh-CN/docs/Web/API/ParentNode/lastElementChild /zh-CN/docs/Web/API/ParentNode/childElementCount /zh-CN/docs/Web/API/Element/childElementCount +/zh-CN/docs/Web/API/ParentNode/children /zh-CN/docs/orphaned/Web/API/ParentNode/children /zh-CN/docs/Web/API/Performance.now() /zh-CN/docs/Web/API/Performance/now /zh-CN/docs/Web/API/Performance/内存 /zh-CN/docs/Web/API/Performance/memory /zh-CN/docs/Web/API/Position /zh-CN/docs/Web/API/GeolocationPosition diff --git a/files/zh-cn/_wikihistory.json b/files/zh-cn/_wikihistory.json index 9f0050198c..16eb345f2b 100644 --- a/files/zh-cn/_wikihistory.json +++ b/files/zh-cn/_wikihistory.json @@ -16794,17 +16794,6 @@ "ziyunfei" ] }, - "Web/API/ParentNode/children": { - "modified": "2019-10-05T16:42:46.088Z", - "contributors": [ - "xiaoxiyao", - "xgqfrms-GitHub", - "teoli", - "khalid32", - "ziyunfei", - "AlexChao" - ] - }, "Web/API/ParentNode/firstElementChild": { "modified": "2020-10-15T21:06:48.165Z", "contributors": [ @@ -50798,5 +50787,16 @@ "peonyriver", "FredWe" ] + }, + "orphaned/Web/API/ParentNode/children": { + "modified": "2019-10-05T16:42:46.088Z", + "contributors": [ + "xiaoxiyao", + "xgqfrms-GitHub", + "teoli", + "khalid32", + "ziyunfei", + "AlexChao" + ] } } \ No newline at end of file diff --git a/files/zh-cn/orphaned/web/api/parentnode/children/index.html b/files/zh-cn/orphaned/web/api/parentnode/children/index.html new file mode 100644 index 0000000000..70a02ddcca --- /dev/null +++ b/files/zh-cn/orphaned/web/api/parentnode/children/index.html @@ -0,0 +1,118 @@ +--- +title: ParentNode.children +slug: orphaned/Web/API/ParentNode/children +tags: + - Property +translation_of: Web/API/ParentNode/children +original_slug: Web/API/ParentNode/children +--- +<p>{{ APIRef("DOM") }}</p> + +<p><code><strong>ParentNode.children </strong></code>是一个只读属性,返回 一个Node的子{{domxref("Element","elements")}} ,是一个动态更新的 {{domxref("HTMLCollection")}}。</p> + +<h2 id="Syntax_and_values" name="Syntax_and_values">语法</h2> + +<pre>var <em>children</em> = <em>node</em>.children;</pre> + +<pre class="eval">var <em>elList</em> = elementNodeReference.children; +</pre> + +<h2 id="Notes" name="Notes">备注</h2> + +<p><code>children</code> 属性为只读属性,对象类型为 {{ domxref("HTMLCollection") }},你可以使用 <code>elementNodeReference.children[1].nodeName</code> 来获取某个子元素的标签名称。</p> + +<h2 id="Example" name="Example">例子</h2> + +<pre class="brush: js">// parg是一个指向<p>元素的对象引用 +if (parg.childElementCount) +// 检查这个<p>元素是否有子元素 +// 译者注:childElementCount有兼容性问题 + { + var children = parg.children; + for (var i = 0; i < children.length; i++) + { + // 通过children[i]来获取每个子元素 + // 注意:List是一个live的HTMLCollection对象,在这里添加或删除parg的子元素节点,都会立即改变List的值. + }; + }; +</pre> + +<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2> + +<p> </p> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('DOM WHATWG', '#dom-parentnode-children', 'ParentNode.children')}}</td> + <td>{{Spec2('DOM WHATWG')}}</td> + <td>Initial definition.</td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容性">浏览器兼容性</h2> + +<p>{{ CompatibilityTable() }}</p> + +<div id="compat-desktop"> +<table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Chrome</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Opera</th> + <th>Safari</th> + </tr> + <tr> + <td>Basic support</td> + <td>1</td> + <td>3.5</td> + <td>9 (IE6-8 incl commend nodes)</td> + <td>10</td> + <td>4</td> + </tr> + </tbody> +</table> +</div> + +<div id="compat-mobile"> +<table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Android</th> + <th>Firefox Mobile (Gecko)</th> + <th>IE Mobile</th> + <th>Opera Mobile</th> + <th>Safari Mobile</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{ CompatVersionUnknown() }}</td> + <td>{{ CompatVersionUnknown() }}</td> + <td>{{ CompatVersionUnknown() }}</td> + <td>{{ CompatVersionUnknown() }}</td> + <td>{{ CompatVersionUnknown() }}<span style="font-size: 14px; line-height: 1.5;"></span></td> + </tr> + </tbody> +</table> +</div> + +<p style="margin-bottom: 20px; line-height: 30px;">[1] Internet Explorer 6 - 8 支持该属性,但是可能会错误地包含注释 {{domxref("Comment")}} 节点。</p> + +<h2 id="相关链接" style="margin-bottom: 20px; line-height: 30px;">相关链接</h2> + +<ul> + <li>The {{domxref("ParentNode")}} and {{domxref("ChildNode")}} pure interfaces.</li> + <li> + <div class="syntaxbox">Object types implementing this pure interface: {{domxref("Document")}}, {{domxref("Element")}}, and {{domxref("DocumentFragment")}}.</div> + </li> +</ul> diff --git a/files/zh-cn/web/api/parentnode/children/index.html b/files/zh-cn/web/api/parentnode/children/index.html deleted file mode 100644 index 35419a52b6..0000000000 --- a/files/zh-cn/web/api/parentnode/children/index.html +++ /dev/null @@ -1,117 +0,0 @@ ---- -title: ParentNode.children -slug: Web/API/ParentNode/children -tags: - - Property -translation_of: Web/API/ParentNode/children ---- -<p>{{ APIRef("DOM") }}</p> - -<p><code><strong>ParentNode.children </strong></code>是一个只读属性,返回 一个Node的子{{domxref("Element","elements")}} ,是一个动态更新的 {{domxref("HTMLCollection")}}。</p> - -<h2 id="Syntax_and_values" name="Syntax_and_values">语法</h2> - -<pre>var <em>children</em> = <em>node</em>.children;</pre> - -<pre class="eval">var <em>elList</em> = elementNodeReference.children; -</pre> - -<h2 id="Notes" name="Notes">备注</h2> - -<p><code>children</code> 属性为只读属性,对象类型为 {{ domxref("HTMLCollection") }},你可以使用 <code>elementNodeReference.children[1].nodeName</code> 来获取某个子元素的标签名称。</p> - -<h2 id="Example" name="Example">例子</h2> - -<pre class="brush: js">// parg是一个指向<p>元素的对象引用 -if (parg.childElementCount) -// 检查这个<p>元素是否有子元素 -// 译者注:childElementCount有兼容性问题 - { - var children = parg.children; - for (var i = 0; i < children.length; i++) - { - // 通过children[i]来获取每个子元素 - // 注意:List是一个live的HTMLCollection对象,在这里添加或删除parg的子元素节点,都会立即改变List的值. - }; - }; -</pre> - -<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2> - -<p> </p> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Specification</th> - <th scope="col">Status</th> - <th scope="col">Comment</th> - </tr> - <tr> - <td>{{SpecName('DOM WHATWG', '#dom-parentnode-children', 'ParentNode.children')}}</td> - <td>{{Spec2('DOM WHATWG')}}</td> - <td>Initial definition.</td> - </tr> - </tbody> -</table> - -<h2 id="浏览器兼容性">浏览器兼容性</h2> - -<p>{{ CompatibilityTable() }}</p> - -<div id="compat-desktop"> -<table class="compat-table"> - <tbody> - <tr> - <th>Feature</th> - <th>Chrome</th> - <th>Firefox (Gecko)</th> - <th>Internet Explorer</th> - <th>Opera</th> - <th>Safari</th> - </tr> - <tr> - <td>Basic support</td> - <td>1</td> - <td>3.5</td> - <td>9 (IE6-8 incl commend nodes)</td> - <td>10</td> - <td>4</td> - </tr> - </tbody> -</table> -</div> - -<div id="compat-mobile"> -<table class="compat-table"> - <tbody> - <tr> - <th>Feature</th> - <th>Android</th> - <th>Firefox Mobile (Gecko)</th> - <th>IE Mobile</th> - <th>Opera Mobile</th> - <th>Safari Mobile</th> - </tr> - <tr> - <td>Basic support</td> - <td>{{ CompatVersionUnknown() }}</td> - <td>{{ CompatVersionUnknown() }}</td> - <td>{{ CompatVersionUnknown() }}</td> - <td>{{ CompatVersionUnknown() }}</td> - <td>{{ CompatVersionUnknown() }}<span style="font-size: 14px; line-height: 1.5;"></span></td> - </tr> - </tbody> -</table> -</div> - -<p style="margin-bottom: 20px; line-height: 30px;">[1] Internet Explorer 6 - 8 支持该属性,但是可能会错误地包含注释 {{domxref("Comment")}} 节点。</p> - -<h2 id="相关链接" style="margin-bottom: 20px; line-height: 30px;">相关链接</h2> - -<ul> - <li>The {{domxref("ParentNode")}} and {{domxref("ChildNode")}} pure interfaces.</li> - <li> - <div class="syntaxbox">Object types implementing this pure interface: {{domxref("Document")}}, {{domxref("Element")}}, and {{domxref("DocumentFragment")}}.</div> - </li> -</ul> diff --git a/files/zh-tw/_redirects.txt b/files/zh-tw/_redirects.txt index 580f746e41..24c794b2b8 100644 --- a/files/zh-tw/_redirects.txt +++ b/files/zh-tw/_redirects.txt @@ -576,6 +576,7 @@ /zh-TW/docs/Web/API/HTMLElement/style /zh-TW/docs/Web/API/ElementCSSInlineStyle/style /zh-TW/docs/Web/API/Node/innerText /zh-TW/docs/Web/API/HTMLElement/innerText /zh-TW/docs/Web/API/NonDocumentTypeChildNode /zh-TW/docs/conflicting/Web/API/Element +/zh-TW/docs/Web/API/ParentNode/children /zh-TW/docs/orphaned/Web/API/ParentNode/children /zh-TW/docs/Web/API/Performance.timing /zh-TW/docs/Web/API/Performance/timing /zh-TW/docs/Web/API/Position /zh-TW/docs/Web/API/GeolocationPosition /zh-TW/docs/Web/API/Position/coords /zh-TW/docs/Web/API/GeolocationPosition/coords diff --git a/files/zh-tw/_wikihistory.json b/files/zh-tw/_wikihistory.json index 6cfe713ced..f702d4e4df 100644 --- a/files/zh-tw/_wikihistory.json +++ b/files/zh-tw/_wikihistory.json @@ -4233,12 +4233,6 @@ "jackblackevo" ] }, - "Web/API/ParentNode/children": { - "modified": "2019-03-23T22:12:04.488Z", - "contributors": [ - "jackblackevo" - ] - }, "Web/API/ParentNode/firstElementChild": { "modified": "2020-10-15T22:25:38.862Z", "contributors": [ @@ -9152,5 +9146,11 @@ "contributors": [ "jackblackevo" ] + }, + "orphaned/Web/API/ParentNode/children": { + "modified": "2019-03-23T22:12:04.488Z", + "contributors": [ + "jackblackevo" + ] } } \ No newline at end of file diff --git a/files/zh-tw/orphaned/web/api/parentnode/children/index.html b/files/zh-tw/orphaned/web/api/parentnode/children/index.html new file mode 100644 index 0000000000..4ec1f5a90b --- /dev/null +++ b/files/zh-tw/orphaned/web/api/parentnode/children/index.html @@ -0,0 +1,153 @@ +--- +title: ParentNode.children +slug: orphaned/Web/API/ParentNode/children +translation_of: Web/API/ParentNode/children +original_slug: Web/API/ParentNode/children +--- +<p>{{ APIRef("DOM") }}</p> + +<p><code><strong>Node.children</strong></code> 唯讀屬性會回傳一個 <code>Node</code> 之子{{domxref("Element","元素")}}的動態(live){{domxref("HTMLCollection")}}。</p> + +<h2 id="語法">語法</h2> + +<pre class="syntaxbox">var <em>children</em> = <em>node</em>.children;</pre> + +<p><code><em>children</em></code> 是一個 {{ domxref("HTMLCollection") }},為一個有順序性、由 <em><code>node</code></em> 中的 DOM 子元素所組成的集合。假如沒有子元素,則 <code><em>children</em></code> 內便不包含任何元素,且 <code>length</code> 為 <code>0</code>。</p> + +<h2 id="範例">範例</h2> + +<pre class="brush: js">var foo = document.getElementById('foo'); +for (var i = 0; i < foo.children.length; i++) { + console.log(foo.children[i].tagName); +} +</pre> + +<h2 id="Polyfill">Polyfill</h2> + +<pre class="brush: js">// Overwrites native 'children' prototype. +// Adds Document & DocumentFragment support for IE9 & Safari. +// Returns array instead of HTMLCollection. +;(function(constructor) { + if (constructor && + constructor.prototype && + constructor.prototype.children == null) { + Object.defineProperty(constructor.prototype, 'children', { + get: function() { + var i = 0, node, nodes = this.childNodes, children = []; + while (node = nodes[i++]) { + if (node.nodeType === 1) { + children.push(node); + } + } + return children; + } + }); + } +})(window.Node || window.Element); +</pre> + +<h2 id="規範">規範</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('DOM WHATWG', '#dom-parentnode-children', 'ParentNode.children')}}</td> + <td>{{Spec2('DOM WHATWG')}}</td> + <td>Initial definition.</td> + </tr> + </tbody> +</table> + +<h2 id="瀏覽器相容性">瀏覽器相容性</h2> + +<p>{{ CompatibilityTable() }}</p> + +<div id="compat-desktop"> +<table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Chrome</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Edge</th> + <th>Opera</th> + <th>Safari</th> + </tr> + <tr> + <td>Basic support (on {{domxref("Element")}})</td> + <td>1.0</td> + <td>{{CompatGeckoDesktop("1.9.1")}}</td> + <td>9.0 [1]</td> + <td>38.0</td> + <td>10.0</td> + <td>4.0</td> + </tr> + <tr> + <td>Support on {{domxref("Document")}} and {{domxref("DocumentFragment")}} {{experimental_inline}}</td> + <td>29.0</td> + <td>{{CompatGeckoDesktop("25.0")}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>16.0</td> + <td>{{CompatNo}}</td> + </tr> + <tr> + <td>Support on {{domxref("SVGElement")}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> + +<div id="compat-mobile"> +<table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Android</th> + <th>Firefox Mobile (Gecko)</th> + <th>IE Mobile</th> + <th>Opera Mobile</th> + <th>Safari Mobile</th> + </tr> + <tr> + <td>Basic support (on {{domxref("Element")}})</td> + <td>{{ CompatVersionUnknown() }}</td> + <td>{{CompatGeckoMobile("1.9.1")}}</td> + <td>{{ CompatVersionUnknown() }}</td> + <td>{{ CompatVersionUnknown() }}</td> + <td>{{ CompatVersionUnknown() }}</td> + </tr> + <tr> + <td>Support on {{domxref("Document")}} and {{domxref("DocumentFragment")}} {{experimental_inline}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatGeckoMobile("25.0")}}</td> + <td>{{CompatNo}}</td> + <td>16.0</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> + +<p>[1] Internet Explorer 6, 7 and 8 supported it, but erroneously includes {{domxref("Comment")}} nodes.</p> + +<h2 id="參見">參見</h2> + +<ul> + <li>The {{domxref("ParentNode")}} and {{domxref("ChildNode")}} interfaces.</li> + <li> + <div class="syntaxbox">Object types implementing this interface: {{domxref("Document")}}, {{domxref("Element")}}, and {{domxref("DocumentFragment")}}.</div> + </li> +</ul> diff --git a/files/zh-tw/web/api/parentnode/children/index.html b/files/zh-tw/web/api/parentnode/children/index.html deleted file mode 100644 index f9f6c76115..0000000000 --- a/files/zh-tw/web/api/parentnode/children/index.html +++ /dev/null @@ -1,152 +0,0 @@ ---- -title: ParentNode.children -slug: Web/API/ParentNode/children -translation_of: Web/API/ParentNode/children ---- -<p>{{ APIRef("DOM") }}</p> - -<p><code><strong>Node.children</strong></code> 唯讀屬性會回傳一個 <code>Node</code> 之子{{domxref("Element","元素")}}的動態(live){{domxref("HTMLCollection")}}。</p> - -<h2 id="語法">語法</h2> - -<pre class="syntaxbox">var <em>children</em> = <em>node</em>.children;</pre> - -<p><code><em>children</em></code> 是一個 {{ domxref("HTMLCollection") }},為一個有順序性、由 <em><code>node</code></em> 中的 DOM 子元素所組成的集合。假如沒有子元素,則 <code><em>children</em></code> 內便不包含任何元素,且 <code>length</code> 為 <code>0</code>。</p> - -<h2 id="範例">範例</h2> - -<pre class="brush: js">var foo = document.getElementById('foo'); -for (var i = 0; i < foo.children.length; i++) { - console.log(foo.children[i].tagName); -} -</pre> - -<h2 id="Polyfill">Polyfill</h2> - -<pre class="brush: js">// Overwrites native 'children' prototype. -// Adds Document & DocumentFragment support for IE9 & Safari. -// Returns array instead of HTMLCollection. -;(function(constructor) { - if (constructor && - constructor.prototype && - constructor.prototype.children == null) { - Object.defineProperty(constructor.prototype, 'children', { - get: function() { - var i = 0, node, nodes = this.childNodes, children = []; - while (node = nodes[i++]) { - if (node.nodeType === 1) { - children.push(node); - } - } - return children; - } - }); - } -})(window.Node || window.Element); -</pre> - -<h2 id="規範">規範</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Specification</th> - <th scope="col">Status</th> - <th scope="col">Comment</th> - </tr> - <tr> - <td>{{SpecName('DOM WHATWG', '#dom-parentnode-children', 'ParentNode.children')}}</td> - <td>{{Spec2('DOM WHATWG')}}</td> - <td>Initial definition.</td> - </tr> - </tbody> -</table> - -<h2 id="瀏覽器相容性">瀏覽器相容性</h2> - -<p>{{ CompatibilityTable() }}</p> - -<div id="compat-desktop"> -<table class="compat-table"> - <tbody> - <tr> - <th>Feature</th> - <th>Chrome</th> - <th>Firefox (Gecko)</th> - <th>Internet Explorer</th> - <th>Edge</th> - <th>Opera</th> - <th>Safari</th> - </tr> - <tr> - <td>Basic support (on {{domxref("Element")}})</td> - <td>1.0</td> - <td>{{CompatGeckoDesktop("1.9.1")}}</td> - <td>9.0 [1]</td> - <td>38.0</td> - <td>10.0</td> - <td>4.0</td> - </tr> - <tr> - <td>Support on {{domxref("Document")}} and {{domxref("DocumentFragment")}} {{experimental_inline}}</td> - <td>29.0</td> - <td>{{CompatGeckoDesktop("25.0")}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>16.0</td> - <td>{{CompatNo}}</td> - </tr> - <tr> - <td>Support on {{domxref("SVGElement")}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatUnknown}}</td> - <td>{{CompatNo}}</td> - </tr> - </tbody> -</table> -</div> - -<div id="compat-mobile"> -<table class="compat-table"> - <tbody> - <tr> - <th>Feature</th> - <th>Android</th> - <th>Firefox Mobile (Gecko)</th> - <th>IE Mobile</th> - <th>Opera Mobile</th> - <th>Safari Mobile</th> - </tr> - <tr> - <td>Basic support (on {{domxref("Element")}})</td> - <td>{{ CompatVersionUnknown() }}</td> - <td>{{CompatGeckoMobile("1.9.1")}}</td> - <td>{{ CompatVersionUnknown() }}</td> - <td>{{ CompatVersionUnknown() }}</td> - <td>{{ CompatVersionUnknown() }}</td> - </tr> - <tr> - <td>Support on {{domxref("Document")}} and {{domxref("DocumentFragment")}} {{experimental_inline}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatGeckoMobile("25.0")}}</td> - <td>{{CompatNo}}</td> - <td>16.0</td> - <td>{{CompatNo}}</td> - </tr> - </tbody> -</table> -</div> - -<p>[1] Internet Explorer 6, 7 and 8 supported it, but erroneously includes {{domxref("Comment")}} nodes.</p> - -<h2 id="參見">參見</h2> - -<ul> - <li>The {{domxref("ParentNode")}} and {{domxref("ChildNode")}} interfaces.</li> - <li> - <div class="syntaxbox">Object types implementing this interface: {{domxref("Document")}}, {{domxref("Element")}}, and {{domxref("DocumentFragment")}}.</div> - </li> -</ul> -- cgit v1.2.3-54-g00ecf