From 9daad59fa2578dcc9603833b0a9a22b93d362b5e Mon Sep 17 00:00:00 2001 From: MDN Date: Fri, 16 Apr 2021 00:10:51 +0000 Subject: [CRON] sync translated content --- files/es/_redirects.txt | 2 + files/es/_wikihistory.json | 24 +-- .../api/parentnode/firstelementchild/index.html | 144 ++++++++++++++++++ .../web/api/parentnode/lastelementchild/index.html | 147 +++++++++++++++++++ .../api/parentnode/firstelementchild/index.html | 143 ------------------ .../web/api/parentnode/lastelementchild/index.html | 146 ------------------- files/fr/_redirects.txt | 6 +- files/fr/_wikihistory.json | 34 ++--- .../api/parentnode/firstelementchild/index.html | 46 ++++++ .../web/api/parentnode/lastelementchild/index.html | 98 +++++++++++++ .../api/parentnode/firstelementchild/index.html | 45 ------ .../web/api/parentnode/lastelementchild/index.html | 97 ------------ files/it/_redirects.txt | 2 + files/it/_wikihistory.json | 24 +-- .../api/parentnode/firstelementchild/index.html | 100 +++++++++++++ .../web/api/parentnode/lastelementchild/index.html | 99 +++++++++++++ .../api/parentnode/firstelementchild/index.html | 99 ------------- .../web/api/parentnode/lastelementchild/index.html | 98 ------------- files/ru/_redirects.txt | 2 + files/ru/_wikihistory.json | 28 ++-- .../api/parentnode/firstelementchild/index.html | 150 +++++++++++++++++++ .../web/api/parentnode/lastelementchild/index.html | 162 +++++++++++++++++++++ .../api/parentnode/firstelementchild/index.html | 149 ------------------- .../web/api/parentnode/lastelementchild/index.html | 161 -------------------- files/zh-cn/_redirects.txt | 10 +- files/zh-cn/_wikihistory.json | 46 +++--- .../api/parentnode/firstelementchild/index.html | 96 ++++++++++++ .../web/api/parentnode/lastelementchild/index.html | 94 ++++++++++++ .../api/parentnode/firstelementchild/index.html | 95 ------------ .../web/api/parentnode/lastelementchild/index.html | 93 ------------ files/zh-tw/_redirects.txt | 1 + files/zh-tw/_wikihistory.json | 12 +- .../api/parentnode/firstelementchild/index.html | 96 ++++++++++++ .../api/parentnode/firstelementchild/index.html | 95 ------------ 34 files changed, 1333 insertions(+), 1311 deletions(-) create mode 100644 files/es/orphaned/web/api/parentnode/firstelementchild/index.html create mode 100644 files/es/orphaned/web/api/parentnode/lastelementchild/index.html delete mode 100644 files/es/web/api/parentnode/firstelementchild/index.html delete mode 100644 files/es/web/api/parentnode/lastelementchild/index.html create mode 100644 files/fr/orphaned/web/api/parentnode/firstelementchild/index.html create mode 100644 files/fr/orphaned/web/api/parentnode/lastelementchild/index.html delete mode 100644 files/fr/web/api/parentnode/firstelementchild/index.html delete mode 100644 files/fr/web/api/parentnode/lastelementchild/index.html create mode 100644 files/it/orphaned/web/api/parentnode/firstelementchild/index.html create mode 100644 files/it/orphaned/web/api/parentnode/lastelementchild/index.html delete mode 100644 files/it/web/api/parentnode/firstelementchild/index.html delete mode 100644 files/it/web/api/parentnode/lastelementchild/index.html create mode 100644 files/ru/orphaned/web/api/parentnode/firstelementchild/index.html create mode 100644 files/ru/orphaned/web/api/parentnode/lastelementchild/index.html delete mode 100644 files/ru/web/api/parentnode/firstelementchild/index.html delete mode 100644 files/ru/web/api/parentnode/lastelementchild/index.html create mode 100644 files/zh-cn/orphaned/web/api/parentnode/firstelementchild/index.html create mode 100644 files/zh-cn/orphaned/web/api/parentnode/lastelementchild/index.html delete mode 100644 files/zh-cn/web/api/parentnode/firstelementchild/index.html delete mode 100644 files/zh-cn/web/api/parentnode/lastelementchild/index.html create mode 100644 files/zh-tw/orphaned/web/api/parentnode/firstelementchild/index.html delete mode 100644 files/zh-tw/web/api/parentnode/firstelementchild/index.html diff --git a/files/es/_redirects.txt b/files/es/_redirects.txt index 751961e8eb..a1e4ec8825 100644 --- a/files/es/_redirects.txt +++ b/files/es/_redirects.txt @@ -1833,6 +1833,8 @@ /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/ParentNode/firstElementChild /es/docs/orphaned/Web/API/ParentNode/firstElementChild +/es/docs/Web/API/ParentNode/lastElementChild /es/docs/orphaned/Web/API/ParentNode/lastElementChild /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 f2fcc7d5f9..15e74b85a8 100644 --- a/files/es/_wikihistory.json +++ b/files/es/_wikihistory.json @@ -5871,18 +5871,6 @@ "Kyuoraku" ] }, - "Web/API/ParentNode/firstElementChild": { - "modified": "2019-03-23T22:32:44.779Z", - "contributors": [ - "Grijander81" - ] - }, - "Web/API/ParentNode/lastElementChild": { - "modified": "2019-03-23T22:32:39.974Z", - "contributors": [ - "Grijander81" - ] - }, "Web/API/Payment_Request_API": { "modified": "2020-10-15T22:33:12.666Z", "contributors": [ @@ -23743,5 +23731,17 @@ "aeroxmotion", "Grijander81" ] + }, + "orphaned/Web/API/ParentNode/firstElementChild": { + "modified": "2019-03-23T22:32:44.779Z", + "contributors": [ + "Grijander81" + ] + }, + "orphaned/Web/API/ParentNode/lastElementChild": { + "modified": "2019-03-23T22:32:39.974Z", + "contributors": [ + "Grijander81" + ] } } \ No newline at end of file diff --git a/files/es/orphaned/web/api/parentnode/firstelementchild/index.html b/files/es/orphaned/web/api/parentnode/firstelementchild/index.html new file mode 100644 index 0000000000..c809951fdf --- /dev/null +++ b/files/es/orphaned/web/api/parentnode/firstelementchild/index.html @@ -0,0 +1,144 @@ +--- +title: ParentNode.firstElementChild +slug: orphaned/Web/API/ParentNode/firstElementChild +translation_of: Web/API/ParentNode/firstElementChild +original_slug: Web/API/ParentNode/firstElementChild +--- +

{{ APIRef("DOM") }}

+ +

La propiedad de sólo lectura ParentNode.firstElementChild retorna el primer hijo del objeto {{domxref("Element")}}, o bien null si no existen elementos hijos.

+ +
+

Esta propiedada fue definida inicialmente en el interfaz puro {{domxref("ElementTraversal")}}. Como este interfaz contenía dos juegos distintos de propiedades, uno orientado a {{domxref("Node")}} que tenía hijos, y otro a aquellos que eran hijos, se trasladaron a dos interfaces puros separados, {{domxref("ParentNode")}} y {{domxref("ChildNode")}}. En este caso, firstElementChild fue movido a {{domxref("ParentNode")}}. Es un cambio de carácter estrictamente técnico que no debería afectar a la compatibilidad.

+
+ +

Sintaxis

+ +
var childNode = elementNodeReference.firstElementChild;
+
+ +

Ejemplo

+ +
<p id="para-01">
+  <span>First span</span>
+</p>
+
+<script type="text/javascript">
+  var p01 = document.getElementById('para-01');
+  alert(p01.firstElementChild.nodeName)
+</script>
+ +

En este ejemlpo, la alerta muestra 'span', que es el nombre de la etiqueta del primer nodo hijo dele elemento párrafo.

+ +

Polyfill para Internet Explorer 8

+ +

Esta propiedad no está soportada con anterioridad a  IE9, así que el siguiente fragmento puede ser usado para añadir el soporte a IE8:

+ +
// Source: https://github.com/Alhadis/Snippets/blob/master/js/polyfills/IE8-child-elements.js
+if(!("firstElementChild" in document.documentElement)){
+    Object.defineProperty(Element.prototype, "firstElementChild", {
+        get: function(){
+            for(var nodes = this.children, n, i = 0, l = nodes.length; i < l; ++i)
+                if(n = nodes[i], 1 === n.nodeType) return n;
+            return null;
+        }
+    });
+}
+ +

Especificación

+ + + + + + + + + + + + + + + + + + + +
EspecificaciónEstadoObservaciones
{{SpecName('DOM WHATWG', '#dom-parentnode-firstelementchild', 'ParentNode.firstElementChild')}}{{Spec2('DOM WHATWG')}}Dividido el interfaz ElementTraversal en {{domxref("ChildNode")}} y ParentNode. Este método queda definido ahora en el segundo.
+ Los {{domxref("Document")}} y {{domxref("DocumentFragment")}} implementaron los nuevos interfaces.
{{SpecName('Element Traversal', '#attribute-firstElementChild', 'ElementTraversal.firstElementChild')}}{{Spec2('Element Traversal')}}Añadida su definición inicial al interfaz puro ElementTraversal y lo usa en {{domxref("Element")}}.
+ +

Compatibilidad con navegadores

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
PrestaciónChromeFirefox (Gecko)Internet ExplorerOperaSafari
Soporte básico (en {{domxref("Element")}})1.0{{CompatGeckoDesktop("1.9.1")}}9.010.04.0
Soporte en {{domxref("Document")}} y {{domxref("DocumentFragment")}} {{experimental_inline}}29.0{{CompatGeckoDesktop("25.0")}}{{CompatNo}}16.0{{CompatNo}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
PrestaciónAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Soporte básico (en {{domxref("Element")}}){{ CompatVersionUnknown() }}{{CompatGeckoMobile("1.9.1")}}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
Soporte en {{domxref("Document")}} y {{domxref("DocumentFragment")}} {{experimental_inline}}{{CompatVersionUnknown}}{{CompatGeckoMobile("25.0")}}{{CompatNo}}16.0{{CompatNo}}
+
+ +

Ver también

+ + diff --git a/files/es/orphaned/web/api/parentnode/lastelementchild/index.html b/files/es/orphaned/web/api/parentnode/lastelementchild/index.html new file mode 100644 index 0000000000..621e139fb8 --- /dev/null +++ b/files/es/orphaned/web/api/parentnode/lastelementchild/index.html @@ -0,0 +1,147 @@ +--- +title: ParentNode.lastElementChild +slug: orphaned/Web/API/ParentNode/lastElementChild +translation_of: Web/API/ParentNode/lastElementChild +original_slug: Web/API/ParentNode/lastElementChild +--- +

{{ APIRef("DOM") }}

+ +

La propiedad de sólo lectura ParentNode.lastElementChild retorna el último hijo del objeto {{domxref("Element")}} o bien null si no hay elementos hijos.

+ +
+

Esta propiedad fue inicialmente definida en el interfaz puro {{domxref("ElementTraversal")}}. Dado que este interfaz contenía dos juegos distintos de propiedades, uno dirigido al nodo {{domxref("Node")}} que tiene hijos, y otro a aquellos que son hijos, se han trasladado a dos interfaces puros separados, {{domxref("ParentNode")}} y {{domxref("ChildNode")}}. En este caso, lastElementChild fue movido a {{domxref("ParentNode")}}. Este es un cambio de carácter técnico que no debería afectar a la compatibilidad.

+
+ +

Sintaxis

+ +
var childNode = elementNodeReference.lastElementChild; 
+ +

Ejemplo

+ +
<p id="para-01">
+  <span>First span</span>
+  <b>bold</b>
+</p>
+
+<script type="text/javascript">
+  var p01 = document.getElementById('para-01');
+  alert(p01.lastElementChild.nodeName)
+</script>
+
+ +

En este ejemplo, la alerta muestra "B", que es el nombre de etiqueta del último nodo hijo del elemento párrafo ("P").

+ +

Polyfill para Internet Explorer 8

+ +

Esta propiedad no está soportada con anterioridad a IE9, así que el siguiente códigopuede ser usado para añadir el soporte a IE8:

+ +
// Source: https://github.com/Alhadis/Snippets/blob/master/js/polyfills/IE8-child-elements.js
+if(!("lastElementChild" in document.documentElement)){
+    Object.defineProperty(Element.prototype, "lastElementChild", {
+        get: function(){
+            for(var nodes = this.children, n, i = nodes.length - 1; i >= 0; --i)
+                if(n = nodes[i], 1 === n.nodeType) return n;
+            return null;
+        }
+    });
+}
+ +

Especificación

+ + + + + + + + + + + + + + + + + + + +
EspecificaciónEstadoObservaciones
{{SpecName('DOM WHATWG', '#dom-parentnode-lastelementchild', 'ParentNode.lastElementChild')}}{{Spec2('DOM WHATWG')}}Dividido el interfaz ElementTraversal en {{domxref("ChildNode")}} y ParentNode. Este método queda ahora definido en el segundo.
+ {{domxref("Document")}} y {{domxref("DocumentFragment")}} implementaron los nuevos interfaces.
{{SpecName('Element Traversal', '#attribute-lastElementChild', 'ElementTraversal.lastElementChild')}}{{Spec2('Element Traversal')}}Añadida su definición inicial al interfaz puro ElementTraversal  y lo usa en {{domxref("Element")}}.
+ +

Compatibilidad con navegadores

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
PrestaciónChromeFirefox (Gecko)Internet ExplorerOperaSafari
Soporte básico (en {{domxref("Element")}})1.0{{CompatGeckoDesktop("1.9.1")}}9.010.04.0
Soporte en {{domxref("Document")}} y {{domxref("DocumentFragment")}} {{experimental_inline}}29.0{{CompatGeckoDesktop("25.0")}}{{CompatNo}}16.0{{CompatNo}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
PrestaciónAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Soporte básico (en {{domxref("Element")}}){{ CompatVersionUnknown() }}{{CompatGeckoMobile("1.9.1")}}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
Soporte en {{domxref("Document")}} y {{domxref("DocumentFragment")}} {{experimental_inline}}{{CompatVersionUnknown}}{{CompatGeckoMobile("25.0")}}{{CompatNo}}16.0{{CompatNo}}
+
+ +

 

+ +

Ver también

+ + diff --git a/files/es/web/api/parentnode/firstelementchild/index.html b/files/es/web/api/parentnode/firstelementchild/index.html deleted file mode 100644 index a9993d8ccf..0000000000 --- a/files/es/web/api/parentnode/firstelementchild/index.html +++ /dev/null @@ -1,143 +0,0 @@ ---- -title: ParentNode.firstElementChild -slug: Web/API/ParentNode/firstElementChild -translation_of: Web/API/ParentNode/firstElementChild ---- -

{{ APIRef("DOM") }}

- -

La propiedad de sólo lectura ParentNode.firstElementChild retorna el primer hijo del objeto {{domxref("Element")}}, o bien null si no existen elementos hijos.

- -
-

Esta propiedada fue definida inicialmente en el interfaz puro {{domxref("ElementTraversal")}}. Como este interfaz contenía dos juegos distintos de propiedades, uno orientado a {{domxref("Node")}} que tenía hijos, y otro a aquellos que eran hijos, se trasladaron a dos interfaces puros separados, {{domxref("ParentNode")}} y {{domxref("ChildNode")}}. En este caso, firstElementChild fue movido a {{domxref("ParentNode")}}. Es un cambio de carácter estrictamente técnico que no debería afectar a la compatibilidad.

-
- -

Sintaxis

- -
var childNode = elementNodeReference.firstElementChild;
-
- -

Ejemplo

- -
<p id="para-01">
-  <span>First span</span>
-</p>
-
-<script type="text/javascript">
-  var p01 = document.getElementById('para-01');
-  alert(p01.firstElementChild.nodeName)
-</script>
- -

En este ejemlpo, la alerta muestra 'span', que es el nombre de la etiqueta del primer nodo hijo dele elemento párrafo.

- -

Polyfill para Internet Explorer 8

- -

Esta propiedad no está soportada con anterioridad a  IE9, así que el siguiente fragmento puede ser usado para añadir el soporte a IE8:

- -
// Source: https://github.com/Alhadis/Snippets/blob/master/js/polyfills/IE8-child-elements.js
-if(!("firstElementChild" in document.documentElement)){
-    Object.defineProperty(Element.prototype, "firstElementChild", {
-        get: function(){
-            for(var nodes = this.children, n, i = 0, l = nodes.length; i < l; ++i)
-                if(n = nodes[i], 1 === n.nodeType) return n;
-            return null;
-        }
-    });
-}
- -

Especificación

- - - - - - - - - - - - - - - - - - - -
EspecificaciónEstadoObservaciones
{{SpecName('DOM WHATWG', '#dom-parentnode-firstelementchild', 'ParentNode.firstElementChild')}}{{Spec2('DOM WHATWG')}}Dividido el interfaz ElementTraversal en {{domxref("ChildNode")}} y ParentNode. Este método queda definido ahora en el segundo.
- Los {{domxref("Document")}} y {{domxref("DocumentFragment")}} implementaron los nuevos interfaces.
{{SpecName('Element Traversal', '#attribute-firstElementChild', 'ElementTraversal.firstElementChild')}}{{Spec2('Element Traversal')}}Añadida su definición inicial al interfaz puro ElementTraversal y lo usa en {{domxref("Element")}}.
- -

Compatibilidad con navegadores

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
PrestaciónChromeFirefox (Gecko)Internet ExplorerOperaSafari
Soporte básico (en {{domxref("Element")}})1.0{{CompatGeckoDesktop("1.9.1")}}9.010.04.0
Soporte en {{domxref("Document")}} y {{domxref("DocumentFragment")}} {{experimental_inline}}29.0{{CompatGeckoDesktop("25.0")}}{{CompatNo}}16.0{{CompatNo}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
PrestaciónAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Soporte básico (en {{domxref("Element")}}){{ CompatVersionUnknown() }}{{CompatGeckoMobile("1.9.1")}}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
Soporte en {{domxref("Document")}} y {{domxref("DocumentFragment")}} {{experimental_inline}}{{CompatVersionUnknown}}{{CompatGeckoMobile("25.0")}}{{CompatNo}}16.0{{CompatNo}}
-
- -

Ver también

- - diff --git a/files/es/web/api/parentnode/lastelementchild/index.html b/files/es/web/api/parentnode/lastelementchild/index.html deleted file mode 100644 index c644b90db8..0000000000 --- a/files/es/web/api/parentnode/lastelementchild/index.html +++ /dev/null @@ -1,146 +0,0 @@ ---- -title: ParentNode.lastElementChild -slug: Web/API/ParentNode/lastElementChild -translation_of: Web/API/ParentNode/lastElementChild ---- -

{{ APIRef("DOM") }}

- -

La propiedad de sólo lectura ParentNode.lastElementChild retorna el último hijo del objeto {{domxref("Element")}} o bien null si no hay elementos hijos.

- -
-

Esta propiedad fue inicialmente definida en el interfaz puro {{domxref("ElementTraversal")}}. Dado que este interfaz contenía dos juegos distintos de propiedades, uno dirigido al nodo {{domxref("Node")}} que tiene hijos, y otro a aquellos que son hijos, se han trasladado a dos interfaces puros separados, {{domxref("ParentNode")}} y {{domxref("ChildNode")}}. En este caso, lastElementChild fue movido a {{domxref("ParentNode")}}. Este es un cambio de carácter técnico que no debería afectar a la compatibilidad.

-
- -

Sintaxis

- -
var childNode = elementNodeReference.lastElementChild; 
- -

Ejemplo

- -
<p id="para-01">
-  <span>First span</span>
-  <b>bold</b>
-</p>
-
-<script type="text/javascript">
-  var p01 = document.getElementById('para-01');
-  alert(p01.lastElementChild.nodeName)
-</script>
-
- -

En este ejemplo, la alerta muestra "B", que es el nombre de etiqueta del último nodo hijo del elemento párrafo ("P").

- -

Polyfill para Internet Explorer 8

- -

Esta propiedad no está soportada con anterioridad a IE9, así que el siguiente códigopuede ser usado para añadir el soporte a IE8:

- -
// Source: https://github.com/Alhadis/Snippets/blob/master/js/polyfills/IE8-child-elements.js
-if(!("lastElementChild" in document.documentElement)){
-    Object.defineProperty(Element.prototype, "lastElementChild", {
-        get: function(){
-            for(var nodes = this.children, n, i = nodes.length - 1; i >= 0; --i)
-                if(n = nodes[i], 1 === n.nodeType) return n;
-            return null;
-        }
-    });
-}
- -

Especificación

- - - - - - - - - - - - - - - - - - - -
EspecificaciónEstadoObservaciones
{{SpecName('DOM WHATWG', '#dom-parentnode-lastelementchild', 'ParentNode.lastElementChild')}}{{Spec2('DOM WHATWG')}}Dividido el interfaz ElementTraversal en {{domxref("ChildNode")}} y ParentNode. Este método queda ahora definido en el segundo.
- {{domxref("Document")}} y {{domxref("DocumentFragment")}} implementaron los nuevos interfaces.
{{SpecName('Element Traversal', '#attribute-lastElementChild', 'ElementTraversal.lastElementChild')}}{{Spec2('Element Traversal')}}Añadida su definición inicial al interfaz puro ElementTraversal  y lo usa en {{domxref("Element")}}.
- -

Compatibilidad con navegadores

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
PrestaciónChromeFirefox (Gecko)Internet ExplorerOperaSafari
Soporte básico (en {{domxref("Element")}})1.0{{CompatGeckoDesktop("1.9.1")}}9.010.04.0
Soporte en {{domxref("Document")}} y {{domxref("DocumentFragment")}} {{experimental_inline}}29.0{{CompatGeckoDesktop("25.0")}}{{CompatNo}}16.0{{CompatNo}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
PrestaciónAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Soporte básico (en {{domxref("Element")}}){{ CompatVersionUnknown() }}{{CompatGeckoMobile("1.9.1")}}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
Soporte en {{domxref("Document")}} y {{domxref("DocumentFragment")}} {{experimental_inline}}{{CompatVersionUnknown}}{{CompatGeckoMobile("25.0")}}{{CompatNo}}16.0{{CompatNo}}
-
- -

 

- -

Ver también

- - diff --git a/files/fr/_redirects.txt b/files/fr/_redirects.txt index 08f6d17707..4fdae5dc7a 100644 --- a/files/fr/_redirects.txt +++ b/files/fr/_redirects.txt @@ -898,7 +898,7 @@ /fr/docs/DOM/DataTransfer /fr/docs/Web/API/DataTransfer /fr/docs/DOM/Document.evaluate /fr/docs/Web/API/Document/evaluate /fr/docs/DOM/Document.implementation /fr/docs/Web/API/Document/implementation -/fr/docs/DOM/Element.firstElementChild /fr/docs/Web/API/ParentNode/firstElementChild +/fr/docs/DOM/Element.firstElementChild /fr/docs/orphaned/Web/API/ParentNode/firstElementChild /fr/docs/DOM/File /fr/docs/Web/API/File /fr/docs/DOM/FileReader /fr/docs/Web/API/FileReader /fr/docs/DOM/FileReader/FileList /fr/docs/Web/API/FileList @@ -3685,7 +3685,7 @@ /fr/docs/Web/API/Element.clientWidth /fr/docs/Web/API/Element/clientWidth /fr/docs/Web/API/Element.cloneNode /fr/docs/Web/API/Node/cloneNode /fr/docs/Web/API/Element.dir /fr/docs/Web/API/HTMLElement/dir -/fr/docs/Web/API/Element.firstElementChild /fr/docs/Web/API/ParentNode/firstElementChild +/fr/docs/Web/API/Element.firstElementChild /fr/docs/orphaned/Web/API/ParentNode/firstElementChild /fr/docs/Web/API/Element.focus /fr/docs/Web/API/HTMLOrForeignElement/focus /fr/docs/Web/API/Element.getAttribute /fr/docs/Web/API/Element/getAttribute /fr/docs/Web/API/Element.getAttributeNS /fr/docs/Web/API/Element/getAttributeNS @@ -3801,6 +3801,8 @@ /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/ParentNode/firstElementChild /fr/docs/orphaned/Web/API/ParentNode/firstElementChild +/fr/docs/Web/API/ParentNode/lastElementChild /fr/docs/orphaned/Web/API/ParentNode/lastElementChild /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 7691f6cf76..20fb17c8e3 100644 --- a/files/fr/_wikihistory.json +++ b/files/fr/_wikihistory.json @@ -11700,23 +11700,6 @@ "ayshiff" ] }, - "Web/API/ParentNode/firstElementChild": { - "modified": "2019-03-23T23:35:50.443Z", - "contributors": [ - "pdonias", - "fscholz", - "teoli", - "khalid32", - "Delapouite", - "Beaver" - ] - }, - "Web/API/ParentNode/lastElementChild": { - "modified": "2019-03-18T21:39:15.409Z", - "contributors": [ - "loella16" - ] - }, "Web/API/ParentNode/prepend": { "modified": "2020-10-15T22:02:32.998Z", "contributors": [ @@ -45335,5 +45318,22 @@ "NemoNobobyPersonne", "xavierartot" ] + }, + "orphaned/Web/API/ParentNode/firstElementChild": { + "modified": "2019-03-23T23:35:50.443Z", + "contributors": [ + "pdonias", + "fscholz", + "teoli", + "khalid32", + "Delapouite", + "Beaver" + ] + }, + "orphaned/Web/API/ParentNode/lastElementChild": { + "modified": "2019-03-18T21:39:15.409Z", + "contributors": [ + "loella16" + ] } } \ No newline at end of file diff --git a/files/fr/orphaned/web/api/parentnode/firstelementchild/index.html b/files/fr/orphaned/web/api/parentnode/firstelementchild/index.html new file mode 100644 index 0000000000..ae70e6aa66 --- /dev/null +++ b/files/fr/orphaned/web/api/parentnode/firstelementchild/index.html @@ -0,0 +1,46 @@ +--- +title: Element.firstElementChild +slug: orphaned/Web/API/ParentNode/firstElementChild +tags: + - Parcours arborescence +translation_of: Web/API/ParentNode/firstElementChild +original_slug: Web/API/ParentNode/firstElementChild +--- +

{{ gecko_minversion_header("1.9.1") }}

+ +

{{ ApiRef() }}

+ +

Résumé

+ +

firstElementChild renvoie le premier élément enfant d'un élément ou null s'il n'y a pas de descendants.

+ +

Syntaxe and valeurs

+ +
var NoeudEnfant = ReferenceElementNoeud.firstElementChild; 
+ +

NoeudEnfant est une référence vers le premier élément enfant de l'élément noeud , ou null s'il n'y en a pas.

+ +

Cet attribut est en lecture seule.

+ +

Exemple

+ +
<p id="para-01">
+  <span>Premier span</span>
+</p>
+
+<script type="text/javascript">
+  var p01 = document.getElementById('para-01');
+  alert(p01.firstElementChild.nodeName)
+</script>
+ +

Dans cet exemple la fonction alert affiche "SPAN", qui est le nom du premier nœud enfant de l'élément paragraphe.

+ +

Voir aussi

+ + diff --git a/files/fr/orphaned/web/api/parentnode/lastelementchild/index.html b/files/fr/orphaned/web/api/parentnode/lastelementchild/index.html new file mode 100644 index 0000000000..8698a44f2b --- /dev/null +++ b/files/fr/orphaned/web/api/parentnode/lastelementchild/index.html @@ -0,0 +1,98 @@ +--- +title: ParentNode.lastElementChild +slug: orphaned/Web/API/ParentNode/lastElementChild +tags: + - API + - DOM + - Noeuds + - Propriétés + - parent +translation_of: Web/API/ParentNode/lastElementChild +original_slug: Web/API/ParentNode/lastElementChild +--- +

{{ APIRef("DOM") }}

+ +

La propriété en lecture seule ParentNode.lastElementChild  renvoie  le dernier enfant de l'objet {{domxref("Element")}} ou null s'il n'y a pas d'élément enfant.

+ +
+

Cette propriiété a été définie initialement dans la pure interface {{domxref("ElementTraversal")}}. Comme cette interface contenait deux différents jeux de propriétés, l'un visant les  {{domxref("Node")}} (noeuds) qui ont des enfants, l'autre les enfants, ils ont été déplacés dans deux interfaces pures, {{domxref("ParentNode")}} et {{domxref("ChildNode")}}. Dans ce cas, childElementCount a été rattaché à {{domxref("ParentNode")}}. C'est un changement assez technique qui ne devrait pas affecter la compatibilité.

+
+ +

Syntaxe

+ +
var element = node.lastElementChild; 
+ +

Exemple

+ +
<ul id="foo">
+  <li>First  (1)</li>
+  <li>Second (2)</li>
+  <li>Third  (3)</li>
+</ul>
+
+<script>
+var foo = document.getElementById('foo');
+// produit : Third  (3)
+console.log(foo.lastElementChild.textContent);
+</script>
+
+ +

Polyfill for IE8, IE9 and Safari

+ +
// Remplace le prototype "lastElementChild" natif.
+// Ajout de Document & DocumentFragment pris en charge pour IE9 & Safari.
+// Renvoie un tableau (array) à la place de HTMLCollection.
+;(function(constructor) {
+    if (constructor &&
+        constructor.prototype &&
+        constructor.prototype.lastElementChild == null) {
+        Object.defineProperty(constructor.prototype, 'lastElementChild', {
+            get: function() {
+                var node, nodes = this.childNodes, i = nodes.length - 1;
+                while (node = nodes[i--]) {
+                    if (node.nodeType === 1) {
+                        return node;
+                    }
+                }
+                return null;
+            }
+        });
+    }
+})(window.Node || window.Element);
+
+ +

Spécification

+ + + + + + + + + + + + + + + + + + + +
SpécificationStatutCommentaire
{{SpecName('DOM WHATWG', '#dom-parentnode-lastelementchild', 'ParentNode.lastElementChild')}}{{Spec2('DOM WHATWG')}}Divise l'interface ElementTraversal en {{domxref("ChildNode")}} et ParentNode. La propriété est maintenant définie sur cette dernière.
+ Les {{domxref("Document")}} et {{domxref("DocumentFragment")}} implémentent la nouvelle interface.
{{SpecName('Element Traversal', '#attribute-lastElementChild', 'ElementTraversal.lastElementChild')}}{{Spec2('Element Traversal')}}Ajout de sa définition initiale à la pure interface ElementTraversal et de son utilisation sur {{domxref("Element")}}.
+ +

Compatibilité des navigateurs

+ +

{{Compat("api.ParentNode.lastElementChild")}}

+ +

Voir aussi

+ + diff --git a/files/fr/web/api/parentnode/firstelementchild/index.html b/files/fr/web/api/parentnode/firstelementchild/index.html deleted file mode 100644 index 60983da28f..0000000000 --- a/files/fr/web/api/parentnode/firstelementchild/index.html +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: Element.firstElementChild -slug: Web/API/ParentNode/firstElementChild -tags: - - Parcours arborescence -translation_of: Web/API/ParentNode/firstElementChild ---- -

{{ gecko_minversion_header("1.9.1") }}

- -

{{ ApiRef() }}

- -

Résumé

- -

firstElementChild renvoie le premier élément enfant d'un élément ou null s'il n'y a pas de descendants.

- -

Syntaxe and valeurs

- -
var NoeudEnfant = ReferenceElementNoeud.firstElementChild; 
- -

NoeudEnfant est une référence vers le premier élément enfant de l'élément noeud , ou null s'il n'y en a pas.

- -

Cet attribut est en lecture seule.

- -

Exemple

- -
<p id="para-01">
-  <span>Premier span</span>
-</p>
-
-<script type="text/javascript">
-  var p01 = document.getElementById('para-01');
-  alert(p01.firstElementChild.nodeName)
-</script>
- -

Dans cet exemple la fonction alert affiche "SPAN", qui est le nom du premier nœud enfant de l'élément paragraphe.

- -

Voir aussi

- - diff --git a/files/fr/web/api/parentnode/lastelementchild/index.html b/files/fr/web/api/parentnode/lastelementchild/index.html deleted file mode 100644 index 152cd3694d..0000000000 --- a/files/fr/web/api/parentnode/lastelementchild/index.html +++ /dev/null @@ -1,97 +0,0 @@ ---- -title: ParentNode.lastElementChild -slug: Web/API/ParentNode/lastElementChild -tags: - - API - - DOM - - Noeuds - - Propriétés - - parent -translation_of: Web/API/ParentNode/lastElementChild ---- -

{{ APIRef("DOM") }}

- -

La propriété en lecture seule ParentNode.lastElementChild  renvoie  le dernier enfant de l'objet {{domxref("Element")}} ou null s'il n'y a pas d'élément enfant.

- -
-

Cette propriiété a été définie initialement dans la pure interface {{domxref("ElementTraversal")}}. Comme cette interface contenait deux différents jeux de propriétés, l'un visant les  {{domxref("Node")}} (noeuds) qui ont des enfants, l'autre les enfants, ils ont été déplacés dans deux interfaces pures, {{domxref("ParentNode")}} et {{domxref("ChildNode")}}. Dans ce cas, childElementCount a été rattaché à {{domxref("ParentNode")}}. C'est un changement assez technique qui ne devrait pas affecter la compatibilité.

-
- -

Syntaxe

- -
var element = node.lastElementChild; 
- -

Exemple

- -
<ul id="foo">
-  <li>First  (1)</li>
-  <li>Second (2)</li>
-  <li>Third  (3)</li>
-</ul>
-
-<script>
-var foo = document.getElementById('foo');
-// produit : Third  (3)
-console.log(foo.lastElementChild.textContent);
-</script>
-
- -

Polyfill for IE8, IE9 and Safari

- -
// Remplace le prototype "lastElementChild" natif.
-// Ajout de Document & DocumentFragment pris en charge pour IE9 & Safari.
-// Renvoie un tableau (array) à la place de HTMLCollection.
-;(function(constructor) {
-    if (constructor &&
-        constructor.prototype &&
-        constructor.prototype.lastElementChild == null) {
-        Object.defineProperty(constructor.prototype, 'lastElementChild', {
-            get: function() {
-                var node, nodes = this.childNodes, i = nodes.length - 1;
-                while (node = nodes[i--]) {
-                    if (node.nodeType === 1) {
-                        return node;
-                    }
-                }
-                return null;
-            }
-        });
-    }
-})(window.Node || window.Element);
-
- -

Spécification

- - - - - - - - - - - - - - - - - - - -
SpécificationStatutCommentaire
{{SpecName('DOM WHATWG', '#dom-parentnode-lastelementchild', 'ParentNode.lastElementChild')}}{{Spec2('DOM WHATWG')}}Divise l'interface ElementTraversal en {{domxref("ChildNode")}} et ParentNode. La propriété est maintenant définie sur cette dernière.
- Les {{domxref("Document")}} et {{domxref("DocumentFragment")}} implémentent la nouvelle interface.
{{SpecName('Element Traversal', '#attribute-lastElementChild', 'ElementTraversal.lastElementChild')}}{{Spec2('Element Traversal')}}Ajout de sa définition initiale à la pure interface ElementTraversal et de son utilisation sur {{domxref("Element")}}.
- -

Compatibilité des navigateurs

- -

{{Compat("api.ParentNode.lastElementChild")}}

- -

Voir aussi

- - diff --git a/files/it/_redirects.txt b/files/it/_redirects.txt index 4a4e9cfcb4..7a2568c2f6 100644 --- a/files/it/_redirects.txt +++ b/files/it/_redirects.txt @@ -528,6 +528,8 @@ /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/ParentNode/firstElementChild /it/docs/orphaned/Web/API/ParentNode/firstElementChild +/it/docs/Web/API/ParentNode/lastElementChild /it/docs/orphaned/Web/API/ParentNode/lastElementChild /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 d79fc797b5..1292ca9ae5 100644 --- a/files/it/_wikihistory.json +++ b/files/it/_wikihistory.json @@ -1643,18 +1643,6 @@ "ExE-Boss" ] }, - "Web/API/ParentNode/firstElementChild": { - "modified": "2020-10-15T22:17:20.523Z", - "contributors": [ - "IsibisiDev" - ] - }, - "Web/API/ParentNode/lastElementChild": { - "modified": "2020-10-15T22:17:20.462Z", - "contributors": [ - "IsibisiDev" - ] - }, "Web/API/Performance": { "modified": "2020-10-15T22:10:46.200Z", "contributors": [ @@ -5994,5 +5982,17 @@ "contributors": [ "IsibisiDev" ] + }, + "orphaned/Web/API/ParentNode/firstElementChild": { + "modified": "2020-10-15T22:17:20.523Z", + "contributors": [ + "IsibisiDev" + ] + }, + "orphaned/Web/API/ParentNode/lastElementChild": { + "modified": "2020-10-15T22:17:20.462Z", + "contributors": [ + "IsibisiDev" + ] } } \ No newline at end of file diff --git a/files/it/orphaned/web/api/parentnode/firstelementchild/index.html b/files/it/orphaned/web/api/parentnode/firstelementchild/index.html new file mode 100644 index 0000000000..4a76fb11dd --- /dev/null +++ b/files/it/orphaned/web/api/parentnode/firstelementchild/index.html @@ -0,0 +1,100 @@ +--- +title: ParentNode.firstElementChild +slug: orphaned/Web/API/ParentNode/firstElementChild +tags: + - API + - DOM + - ParentNode + - Proprietà +translation_of: Web/API/ParentNode/firstElementChild +original_slug: Web/API/ParentNode/firstElementChild +--- +

{{ APIRef("DOM") }}

+ +

La proprietà ParentNode.firstElementChild di sola lettura restituisce il primo figlio {{domxref("Element")}} dell'oggetto, oppure null se non ha elementi figli.

+ +
+

Questa proprietà era inizialmente definita nell'interfaccia pura {{domxref("ElementTraversal")}} pure interface. Poiché questa interfaccia conteneva due distinti set di proprietà, una diretta al {{domxref("Node")}} che ha figli, una a quelli che sono figli, sono stati spostati in due interfacce pure separate, {{domxref("ParentNode")}} e {{domxref("ChildNode")}}. In questo caso, firstElementChild è stato spostato su {{domxref("ParentNode")}}. Questa è una modifica abbastanza tecnica che non dovrebbe influire sulla compatibilità.

+
+ +

Sintassi

+ +
var element = node.firstElementChild;
+
+ +

Esempio

+ +
<ul id="foo">
+  <li>First  (1)</li>
+  <li>Second (2)</li>
+  <li>Third  (3)</li>
+</ul>
+
+<script>
+var foo = document.getElementById('foo');
+// yields: First  (1)
+console.log(foo.firstElementChild.textContent);
+</script>
+
+ +

Polyfill per IE8, IE9 e Safari

+ +
// Overwrites native 'firstElementChild' prototype.
+// Adds Document & DocumentFragment support for IE9 & Safari.
+// Returns array instead of HTMLCollection.
+;(function(constructor) {
+    if (constructor &&
+        constructor.prototype &&
+        constructor.prototype.firstElementChild == null) {
+        Object.defineProperty(constructor.prototype, 'firstElementChild', {
+            get: function() {
+                var node, nodes = this.childNodes, i = 0;
+                while (node = nodes[i++]) {
+                    if (node.nodeType === 1) {
+                        return node;
+                    }
+                }
+                return null;
+            }
+        });
+    }
+})(window.Node || window.Element);
+
+ +

Specifiche

+ + + + + + + + + + + + + + + + + + + +
SpecificaStatoCommento
{{SpecName('DOM WHATWG', '#dom-parentnode-firstelementchild', 'ParentNode.firstElementChild')}}{{Spec2('DOM WHATWG')}}Diviso l'interfaccia ElementTraversal in {{domxref("ChildNode")}} e ParentNode. Questo metodo è ora definito su quest'ultimo.
+ Il {{domxref("Document")}} e {{domxref("DocumentFragment")}} implementato le nuove interfacce.
{{SpecName('Element Traversal', '#attribute-firstElementChild', 'ElementTraversal.firstElementChild')}}{{Spec2('Element Traversal')}}Aggiunta la sua definizione iniziale all'interfaccia pura ElementTraversal e usarla su {{domxref("Element")}}.
+ +

Compatibilità con i browser

+ + + +

{{Compat("api.ParentNode.firstElementChild")}}

+ +

Vedi anche

+ + diff --git a/files/it/orphaned/web/api/parentnode/lastelementchild/index.html b/files/it/orphaned/web/api/parentnode/lastelementchild/index.html new file mode 100644 index 0000000000..d1876d8164 --- /dev/null +++ b/files/it/orphaned/web/api/parentnode/lastelementchild/index.html @@ -0,0 +1,99 @@ +--- +title: ParentNode.lastElementChild +slug: orphaned/Web/API/ParentNode/lastElementChild +tags: + - API + - DOM + - ParentNode + - Proprietà +translation_of: Web/API/ParentNode/lastElementChild +original_slug: Web/API/ParentNode/lastElementChild +--- +

{{ APIRef("DOM") }}

+ +

La proprietà ParentNode.LastElementChild di sola lettura restituisce l'ultimo figlio Element dell'oggetto, oppure null se non ha elementi figli.

+ +
+

Questa proprietà era inizialmente definita nell'interfaccia pura {{domxref("ElementTraversal")}} pure interface. Poiché questa interfaccia conteneva due distinti set di proprietà, una diretta al {{domxref("Node")}} che ha figli, una a quelli che sono figli, sono stati spostati in due interfacce pure separate, {{domxref("ParentNode")}} e {{domxref("ChildNode")}}. In questo caso, lastElementChild è stato spostato su {{domxref("ParentNode")}}. Questa è una modifica abbastanza tecnica che non dovrebbe influire sulla compatibilità.

+
+ +

Sintassi

+ +
var element = node.lastElementChild; 
+ +

Esempio

+ +
<ul id="foo">
+  <li>First  (1)</li>
+  <li>Second (2)</li>
+  <li>Third  (3)</li>
+</ul>
+
+<script>
+var foo = document.getElementById('foo');
+// yields: Third  (3)
+console.log(foo.lastElementChild.textContent);
+</script>
+
+ +

Polyfill per IE8, IE9 e Safari

+ +
// Overwrites native 'lastElementChild' prototype.
+// Adds Document & DocumentFragment support for IE9 & Safari.
+// Returns array instead of HTMLCollection.
+;(function(constructor) {
+    if (constructor &&
+        constructor.prototype &&
+        constructor.prototype.lastElementChild == null) {
+        Object.defineProperty(constructor.prototype, 'lastElementChild', {
+            get: function() {
+                var node, nodes = this.childNodes, i = nodes.length - 1;
+                while (node = nodes[i--]) {
+                    if (node.nodeType === 1) {
+                        return node;
+                    }
+                }
+                return null;
+            }
+        });
+    }
+})(window.Node || window.Element);
+
+ +

Specifiche

+ + + + + + + + + + + + + + + + + + + +
SpecificaStatoCommento
{{SpecName('DOM WHATWG', '#dom-parentnode-firstelementchild', 'ParentNode.firstElementChild')}}{{Spec2('DOM WHATWG')}}Diviso l'interfaccia ElementTraversal in {{domxref("ChildNode")}} e ParentNode. Questo metodo è ora definito su quest'ultimo.
+ Il {{domxref("Document")}} e {{domxref("DocumentFragment")}} implementato le nuove interfacce.
{{SpecName('Element Traversal', '#attribute-firstElementChild', 'ElementTraversal.firstElementChild')}}{{Spec2('Element Traversal')}}Aggiunta la sua definizione iniziale all'interfaccia pura ElementTraversal e usarla su {{domxref("Element")}}.
+ +

Compatibilità con i browser

+ + + +

{{Compat("api.ParentNode.firstElementChild")}}

+ +

Vedi anche

+ + diff --git a/files/it/web/api/parentnode/firstelementchild/index.html b/files/it/web/api/parentnode/firstelementchild/index.html deleted file mode 100644 index 472b7737a3..0000000000 --- a/files/it/web/api/parentnode/firstelementchild/index.html +++ /dev/null @@ -1,99 +0,0 @@ ---- -title: ParentNode.firstElementChild -slug: Web/API/ParentNode/firstElementChild -tags: - - API - - DOM - - ParentNode - - Proprietà -translation_of: Web/API/ParentNode/firstElementChild ---- -

{{ APIRef("DOM") }}

- -

La proprietà ParentNode.firstElementChild di sola lettura restituisce il primo figlio {{domxref("Element")}} dell'oggetto, oppure null se non ha elementi figli.

- -
-

Questa proprietà era inizialmente definita nell'interfaccia pura {{domxref("ElementTraversal")}} pure interface. Poiché questa interfaccia conteneva due distinti set di proprietà, una diretta al {{domxref("Node")}} che ha figli, una a quelli che sono figli, sono stati spostati in due interfacce pure separate, {{domxref("ParentNode")}} e {{domxref("ChildNode")}}. In questo caso, firstElementChild è stato spostato su {{domxref("ParentNode")}}. Questa è una modifica abbastanza tecnica che non dovrebbe influire sulla compatibilità.

-
- -

Sintassi

- -
var element = node.firstElementChild;
-
- -

Esempio

- -
<ul id="foo">
-  <li>First  (1)</li>
-  <li>Second (2)</li>
-  <li>Third  (3)</li>
-</ul>
-
-<script>
-var foo = document.getElementById('foo');
-// yields: First  (1)
-console.log(foo.firstElementChild.textContent);
-</script>
-
- -

Polyfill per IE8, IE9 e Safari

- -
// Overwrites native 'firstElementChild' prototype.
-// Adds Document & DocumentFragment support for IE9 & Safari.
-// Returns array instead of HTMLCollection.
-;(function(constructor) {
-    if (constructor &&
-        constructor.prototype &&
-        constructor.prototype.firstElementChild == null) {
-        Object.defineProperty(constructor.prototype, 'firstElementChild', {
-            get: function() {
-                var node, nodes = this.childNodes, i = 0;
-                while (node = nodes[i++]) {
-                    if (node.nodeType === 1) {
-                        return node;
-                    }
-                }
-                return null;
-            }
-        });
-    }
-})(window.Node || window.Element);
-
- -

Specifiche

- - - - - - - - - - - - - - - - - - - -
SpecificaStatoCommento
{{SpecName('DOM WHATWG', '#dom-parentnode-firstelementchild', 'ParentNode.firstElementChild')}}{{Spec2('DOM WHATWG')}}Diviso l'interfaccia ElementTraversal in {{domxref("ChildNode")}} e ParentNode. Questo metodo è ora definito su quest'ultimo.
- Il {{domxref("Document")}} e {{domxref("DocumentFragment")}} implementato le nuove interfacce.
{{SpecName('Element Traversal', '#attribute-firstElementChild', 'ElementTraversal.firstElementChild')}}{{Spec2('Element Traversal')}}Aggiunta la sua definizione iniziale all'interfaccia pura ElementTraversal e usarla su {{domxref("Element")}}.
- -

Compatibilità con i browser

- - - -

{{Compat("api.ParentNode.firstElementChild")}}

- -

Vedi anche

- - diff --git a/files/it/web/api/parentnode/lastelementchild/index.html b/files/it/web/api/parentnode/lastelementchild/index.html deleted file mode 100644 index 006a3a316d..0000000000 --- a/files/it/web/api/parentnode/lastelementchild/index.html +++ /dev/null @@ -1,98 +0,0 @@ ---- -title: ParentNode.lastElementChild -slug: Web/API/ParentNode/lastElementChild -tags: - - API - - DOM - - ParentNode - - Proprietà -translation_of: Web/API/ParentNode/lastElementChild ---- -

{{ APIRef("DOM") }}

- -

La proprietà ParentNode.LastElementChild di sola lettura restituisce l'ultimo figlio Element dell'oggetto, oppure null se non ha elementi figli.

- -
-

Questa proprietà era inizialmente definita nell'interfaccia pura {{domxref("ElementTraversal")}} pure interface. Poiché questa interfaccia conteneva due distinti set di proprietà, una diretta al {{domxref("Node")}} che ha figli, una a quelli che sono figli, sono stati spostati in due interfacce pure separate, {{domxref("ParentNode")}} e {{domxref("ChildNode")}}. In questo caso, lastElementChild è stato spostato su {{domxref("ParentNode")}}. Questa è una modifica abbastanza tecnica che non dovrebbe influire sulla compatibilità.

-
- -

Sintassi

- -
var element = node.lastElementChild; 
- -

Esempio

- -
<ul id="foo">
-  <li>First  (1)</li>
-  <li>Second (2)</li>
-  <li>Third  (3)</li>
-</ul>
-
-<script>
-var foo = document.getElementById('foo');
-// yields: Third  (3)
-console.log(foo.lastElementChild.textContent);
-</script>
-
- -

Polyfill per IE8, IE9 e Safari

- -
// Overwrites native 'lastElementChild' prototype.
-// Adds Document & DocumentFragment support for IE9 & Safari.
-// Returns array instead of HTMLCollection.
-;(function(constructor) {
-    if (constructor &&
-        constructor.prototype &&
-        constructor.prototype.lastElementChild == null) {
-        Object.defineProperty(constructor.prototype, 'lastElementChild', {
-            get: function() {
-                var node, nodes = this.childNodes, i = nodes.length - 1;
-                while (node = nodes[i--]) {
-                    if (node.nodeType === 1) {
-                        return node;
-                    }
-                }
-                return null;
-            }
-        });
-    }
-})(window.Node || window.Element);
-
- -

Specifiche

- - - - - - - - - - - - - - - - - - - -
SpecificaStatoCommento
{{SpecName('DOM WHATWG', '#dom-parentnode-firstelementchild', 'ParentNode.firstElementChild')}}{{Spec2('DOM WHATWG')}}Diviso l'interfaccia ElementTraversal in {{domxref("ChildNode")}} e ParentNode. Questo metodo è ora definito su quest'ultimo.
- Il {{domxref("Document")}} e {{domxref("DocumentFragment")}} implementato le nuove interfacce.
{{SpecName('Element Traversal', '#attribute-firstElementChild', 'ElementTraversal.firstElementChild')}}{{Spec2('Element Traversal')}}Aggiunta la sua definizione iniziale all'interfaccia pura ElementTraversal e usarla su {{domxref("Element")}}.
- -

Compatibilità con i browser

- - - -

{{Compat("api.ParentNode.firstElementChild")}}

- -

Vedi anche

- - diff --git a/files/ru/_redirects.txt b/files/ru/_redirects.txt index 1ccfb65842..6e5c5df487 100644 --- a/files/ru/_redirects.txt +++ b/files/ru/_redirects.txt @@ -455,6 +455,8 @@ /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/ParentNode/firstElementChild /ru/docs/orphaned/Web/API/ParentNode/firstElementChild +/ru/docs/Web/API/ParentNode/lastElementChild /ru/docs/orphaned/Web/API/ParentNode/lastElementChild /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 c6e56b4a6c..a4231ddeba 100644 --- a/files/ru/_wikihistory.json +++ b/files/ru/_wikihistory.json @@ -6828,20 +6828,6 @@ "madebydima" ] }, - "Web/API/ParentNode/firstElementChild": { - "modified": "2019-08-28T05:08:54.083Z", - "contributors": [ - "Yialo", - "besedin-art" - ] - }, - "Web/API/ParentNode/lastElementChild": { - "modified": "2019-08-28T05:09:39.314Z", - "contributors": [ - "Yialo", - "Waakym" - ] - }, "Web/API/ParentNode/prepend": { "modified": "2020-10-15T22:20:07.127Z", "contributors": [ @@ -25988,5 +25974,19 @@ "evgkit", "In4in" ] + }, + "orphaned/Web/API/ParentNode/firstElementChild": { + "modified": "2019-08-28T05:08:54.083Z", + "contributors": [ + "Yialo", + "besedin-art" + ] + }, + "orphaned/Web/API/ParentNode/lastElementChild": { + "modified": "2019-08-28T05:09:39.314Z", + "contributors": [ + "Yialo", + "Waakym" + ] } } \ No newline at end of file diff --git a/files/ru/orphaned/web/api/parentnode/firstelementchild/index.html b/files/ru/orphaned/web/api/parentnode/firstelementchild/index.html new file mode 100644 index 0000000000..21fb90f963 --- /dev/null +++ b/files/ru/orphaned/web/api/parentnode/firstelementchild/index.html @@ -0,0 +1,150 @@ +--- +title: ParentNode.firstElementChild +slug: orphaned/Web/API/ParentNode/firstElementChild +tags: + - API + - DOM + - ParentNode + - Property + - Reference +translation_of: Web/API/ParentNode/firstElementChild +original_slug: Web/API/ParentNode/firstElementChild +--- +

{{ APIRef("DOM") }}

+ +

Доступное только для чтения свойство ParentNode.firstElementChild возвращает первый дочерний элемент объекта ({{domxref("Element")}}) или null если дочерних элементов нет.

+ +
+

This property was initially defined in the {{domxref("ElementTraversal")}} pure interface. As this interface contained two distinct set of properties, one aimed at {{domxref("Node")}} that have children, one at those that are children, they have been moved into two separate pure interfaces, {{domxref("ParentNode")}} and {{domxref("ChildNode")}}. In this case, firstElementChild moved to {{domxref("ParentNode")}}. This is a fairly technical change that shouldn't affect compatibility.

+
+ +

Синтаксис

+ +
var childNode = elementNodeReference.firstElementChild;
+
+ +

Пример

+ +
<p id="para-01">
+  <span>First span</span>
+</p>
+
+<script type="text/javascript">
+  var p01 = document.getElementById('para-01');
+  alert(p01.firstElementChild.nodeName)
+</script>
+ +

В этом примере alert показывает 'span', что является именем тега первого дочернего узла элемента p.

+ +

Polyfill для Internet Explorer 8

+ +

Это свойство не поддерживается браузером Internet Explorer вплоть до 9 версии, поэтому следующий сниппет может быть использован для добавления поддержки IE8:

+ +
// Source: https://github.com/Alhadis/Snippets/blob/master/js/polyfills/IE8-child-elements.js
+if(!("firstElementChild" in document.documentElement)){
+    Object.defineProperty(Element.prototype, "firstElementChild", {
+        get: function(){
+            for(var nodes = this.children, n, i = 0, l = nodes.length; i < l; ++i)
+                if(n = nodes[i], 1 === n.nodeType) return n;
+            return null;
+        }
+    });
+}
+ +

Спецификация

+ + + + + + + + + + + + + + + + + + + +
СпецификацияСтатусКомментарий
{{SpecName('DOM WHATWG', '#dom-parentnode-firstelementchild', 'ParentNode.firstElementChild')}}{{Spec2('DOM WHATWG')}}Splitted the ElementTraversal interface in {{domxref("ChildNode")}} and ParentNode. This method is now defined on the latter.
+ The {{domxref("Document")}} and {{domxref("DocumentFragment")}} implemented the new interfaces.
{{SpecName('Element Traversal', '#attribute-firstElementChild', 'ElementTraversal.firstElementChild')}}{{Spec2('Element Traversal')}}Added its initial definition to the ElementTraversal pure interface and use it on {{domxref("Element")}}.
+ +

Совместимость с браузерами

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Базовая поддержка ({{domxref("Element")}})1.0{{CompatGeckoDesktop("1.9.1")}}9.010.04.0
Поддержка {{domxref("Document")}} и {{domxref("DocumentFragment")}} {{experimental_inline}}29.0{{CompatGeckoDesktop("25.0")}}{{CompatNo}}16.0{{CompatNo}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Базовая поддержка ({{domxref("Element")}}){{ CompatVersionUnknown() }}{{CompatGeckoMobile("1.9.1")}}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
Поддержка {{domxref("Document")}} и {{domxref("DocumentFragment")}} {{experimental_inline}}{{CompatVersionUnknown}}{{CompatGeckoMobile("25.0")}}{{CompatNo}}16.0{{CompatNo}}
+
+ +

Смотрите также

+ + diff --git a/files/ru/orphaned/web/api/parentnode/lastelementchild/index.html b/files/ru/orphaned/web/api/parentnode/lastelementchild/index.html new file mode 100644 index 0000000000..8df658ceb5 --- /dev/null +++ b/files/ru/orphaned/web/api/parentnode/lastelementchild/index.html @@ -0,0 +1,162 @@ +--- +title: ParentNode.lastElementChild +slug: orphaned/Web/API/ParentNode/lastElementChild +tags: + - API + - DOM + - ParentNode + - Property + - Reference +translation_of: Web/API/ParentNode/lastElementChild +original_slug: Web/API/ParentNode/lastElementChild +--- +

{{ APIRef("DOM") }}

+ +

Свойство ParentNode.lastElementChild только для чтения. Возвращает последний дочерний элемент объекта или null если нет дочерних элементов.

+ +
+

This property was initially defined in the {{domxref("ElementTraversal")}} pure interface. As this interface contained two distinct set of properties, one aimed at {{domxref("Node")}} that have children, one at those that are children, they have been moved into two separate pure interfaces, {{domxref("ParentNode")}} and {{domxref("ChildNode")}}. In this case, lastElementChild moved to {{domxref("ParentNode")}}. This is a fairly technical change that shouldn't affect compatibility.

+
+ +

Синтаксис

+ +
var element = node.lastElementChild; 
+ +

Пример

+ +
<ul id="foo">
+  <li>First  (1)</li>
+  <li>Second (2)</li>
+  <li>Third  (3)</li>
+</ul>
+
+<script>
+var foo = document.getElementById('foo');
+// yields: Third  (3)
+console.log(foo.lastElementChild.textContent);
+</script>
+
+ +

Polyfill for IE8, IE9 and Safari

+ +
// Overwrites native 'lastElementChild' prototype.
+// Adds Document & DocumentFragment support for IE9 & Safari.
+// Returns array instead of HTMLCollection.
+;(function(constructor) {
+    if (constructor &&
+        constructor.prototype &&
+        constructor.prototype.lastElementChild == null) {
+        Object.defineProperty(constructor.prototype, 'lastElementChild', {
+            get: function() {
+                var node, nodes = this.childNodes, i = nodes.length - 1;
+                while (node = nodes[i--]) {
+                    if (node.nodeType === 1) {
+                        return node;
+                    }
+                }
+                return null;
+            }
+        });
+    }
+})(window.Node || window.Element);
+
+ +

Спецификация

+ + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('DOM WHATWG', '#dom-parentnode-lastelementchild', 'ParentNode.lastElementChild')}}{{Spec2('DOM WHATWG')}}Splitted the ElementTraversal interface in {{domxref("ChildNode")}} and ParentNode. This method is now defined on the latter.
+ The {{domxref("Document")}} and {{domxref("DocumentFragment")}} implemented the new interfaces.
{{SpecName('Element Traversal', '#attribute-lastElementChild', 'ElementTraversal.lastElementChild')}}{{Spec2('Element Traversal')}}Added its initial definition to the ElementTraversal pure interface and use it on {{domxref("Element")}}.
+ +

Совместимость с браузерами

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support (on {{domxref("Element")}})1.0{{CompatGeckoDesktop("1.9.1")}}9.010.04.0
Support on {{domxref("Document")}} and {{domxref("DocumentFragment")}} {{experimental_inline}}29.0{{CompatGeckoDesktop("25.0")}}{{CompatNo}}16.0{{CompatNo}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support (on {{domxref("Element")}}){{ CompatVersionUnknown() }}{{CompatGeckoMobile("1.9.1")}}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
Support on {{domxref("Document")}} and {{domxref("DocumentFragment")}} {{experimental_inline}}{{CompatVersionUnknown}}{{CompatGeckoMobile("25.0")}}{{CompatNo}}16.0{{CompatNo}}
+
+ + + +

Так же смотрите

+ + diff --git a/files/ru/web/api/parentnode/firstelementchild/index.html b/files/ru/web/api/parentnode/firstelementchild/index.html deleted file mode 100644 index 9a7275fcc4..0000000000 --- a/files/ru/web/api/parentnode/firstelementchild/index.html +++ /dev/null @@ -1,149 +0,0 @@ ---- -title: ParentNode.firstElementChild -slug: Web/API/ParentNode/firstElementChild -tags: - - API - - DOM - - ParentNode - - Property - - Reference -translation_of: Web/API/ParentNode/firstElementChild ---- -

{{ APIRef("DOM") }}

- -

Доступное только для чтения свойство ParentNode.firstElementChild возвращает первый дочерний элемент объекта ({{domxref("Element")}}) или null если дочерних элементов нет.

- -
-

This property was initially defined in the {{domxref("ElementTraversal")}} pure interface. As this interface contained two distinct set of properties, one aimed at {{domxref("Node")}} that have children, one at those that are children, they have been moved into two separate pure interfaces, {{domxref("ParentNode")}} and {{domxref("ChildNode")}}. In this case, firstElementChild moved to {{domxref("ParentNode")}}. This is a fairly technical change that shouldn't affect compatibility.

-
- -

Синтаксис

- -
var childNode = elementNodeReference.firstElementChild;
-
- -

Пример

- -
<p id="para-01">
-  <span>First span</span>
-</p>
-
-<script type="text/javascript">
-  var p01 = document.getElementById('para-01');
-  alert(p01.firstElementChild.nodeName)
-</script>
- -

В этом примере alert показывает 'span', что является именем тега первого дочернего узла элемента p.

- -

Polyfill для Internet Explorer 8

- -

Это свойство не поддерживается браузером Internet Explorer вплоть до 9 версии, поэтому следующий сниппет может быть использован для добавления поддержки IE8:

- -
// Source: https://github.com/Alhadis/Snippets/blob/master/js/polyfills/IE8-child-elements.js
-if(!("firstElementChild" in document.documentElement)){
-    Object.defineProperty(Element.prototype, "firstElementChild", {
-        get: function(){
-            for(var nodes = this.children, n, i = 0, l = nodes.length; i < l; ++i)
-                if(n = nodes[i], 1 === n.nodeType) return n;
-            return null;
-        }
-    });
-}
- -

Спецификация

- - - - - - - - - - - - - - - - - - - -
СпецификацияСтатусКомментарий
{{SpecName('DOM WHATWG', '#dom-parentnode-firstelementchild', 'ParentNode.firstElementChild')}}{{Spec2('DOM WHATWG')}}Splitted the ElementTraversal interface in {{domxref("ChildNode")}} and ParentNode. This method is now defined on the latter.
- The {{domxref("Document")}} and {{domxref("DocumentFragment")}} implemented the new interfaces.
{{SpecName('Element Traversal', '#attribute-firstElementChild', 'ElementTraversal.firstElementChild')}}{{Spec2('Element Traversal')}}Added its initial definition to the ElementTraversal pure interface and use it on {{domxref("Element")}}.
- -

Совместимость с браузерами

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Базовая поддержка ({{domxref("Element")}})1.0{{CompatGeckoDesktop("1.9.1")}}9.010.04.0
Поддержка {{domxref("Document")}} и {{domxref("DocumentFragment")}} {{experimental_inline}}29.0{{CompatGeckoDesktop("25.0")}}{{CompatNo}}16.0{{CompatNo}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Базовая поддержка ({{domxref("Element")}}){{ CompatVersionUnknown() }}{{CompatGeckoMobile("1.9.1")}}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
Поддержка {{domxref("Document")}} и {{domxref("DocumentFragment")}} {{experimental_inline}}{{CompatVersionUnknown}}{{CompatGeckoMobile("25.0")}}{{CompatNo}}16.0{{CompatNo}}
-
- -

Смотрите также

- - diff --git a/files/ru/web/api/parentnode/lastelementchild/index.html b/files/ru/web/api/parentnode/lastelementchild/index.html deleted file mode 100644 index d625dc316f..0000000000 --- a/files/ru/web/api/parentnode/lastelementchild/index.html +++ /dev/null @@ -1,161 +0,0 @@ ---- -title: ParentNode.lastElementChild -slug: Web/API/ParentNode/lastElementChild -tags: - - API - - DOM - - ParentNode - - Property - - Reference -translation_of: Web/API/ParentNode/lastElementChild ---- -

{{ APIRef("DOM") }}

- -

Свойство ParentNode.lastElementChild только для чтения. Возвращает последний дочерний элемент объекта или null если нет дочерних элементов.

- -
-

This property was initially defined in the {{domxref("ElementTraversal")}} pure interface. As this interface contained two distinct set of properties, one aimed at {{domxref("Node")}} that have children, one at those that are children, they have been moved into two separate pure interfaces, {{domxref("ParentNode")}} and {{domxref("ChildNode")}}. In this case, lastElementChild moved to {{domxref("ParentNode")}}. This is a fairly technical change that shouldn't affect compatibility.

-
- -

Синтаксис

- -
var element = node.lastElementChild; 
- -

Пример

- -
<ul id="foo">
-  <li>First  (1)</li>
-  <li>Second (2)</li>
-  <li>Third  (3)</li>
-</ul>
-
-<script>
-var foo = document.getElementById('foo');
-// yields: Third  (3)
-console.log(foo.lastElementChild.textContent);
-</script>
-
- -

Polyfill for IE8, IE9 and Safari

- -
// Overwrites native 'lastElementChild' prototype.
-// Adds Document & DocumentFragment support for IE9 & Safari.
-// Returns array instead of HTMLCollection.
-;(function(constructor) {
-    if (constructor &&
-        constructor.prototype &&
-        constructor.prototype.lastElementChild == null) {
-        Object.defineProperty(constructor.prototype, 'lastElementChild', {
-            get: function() {
-                var node, nodes = this.childNodes, i = nodes.length - 1;
-                while (node = nodes[i--]) {
-                    if (node.nodeType === 1) {
-                        return node;
-                    }
-                }
-                return null;
-            }
-        });
-    }
-})(window.Node || window.Element);
-
- -

Спецификация

- - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('DOM WHATWG', '#dom-parentnode-lastelementchild', 'ParentNode.lastElementChild')}}{{Spec2('DOM WHATWG')}}Splitted the ElementTraversal interface in {{domxref("ChildNode")}} and ParentNode. This method is now defined on the latter.
- The {{domxref("Document")}} and {{domxref("DocumentFragment")}} implemented the new interfaces.
{{SpecName('Element Traversal', '#attribute-lastElementChild', 'ElementTraversal.lastElementChild')}}{{Spec2('Element Traversal')}}Added its initial definition to the ElementTraversal pure interface and use it on {{domxref("Element")}}.
- -

Совместимость с браузерами

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support (on {{domxref("Element")}})1.0{{CompatGeckoDesktop("1.9.1")}}9.010.04.0
Support on {{domxref("Document")}} and {{domxref("DocumentFragment")}} {{experimental_inline}}29.0{{CompatGeckoDesktop("25.0")}}{{CompatNo}}16.0{{CompatNo}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support (on {{domxref("Element")}}){{ CompatVersionUnknown() }}{{CompatGeckoMobile("1.9.1")}}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
Support on {{domxref("Document")}} and {{domxref("DocumentFragment")}} {{experimental_inline}}{{CompatVersionUnknown}}{{CompatGeckoMobile("25.0")}}{{CompatNo}}16.0{{CompatNo}}
-
- - - -

Так же смотрите

- - diff --git a/files/zh-cn/_redirects.txt b/files/zh-cn/_redirects.txt index e56379facf..5b42e7ce28 100644 --- a/files/zh-cn/_redirects.txt +++ b/files/zh-cn/_redirects.txt @@ -269,8 +269,8 @@ /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/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.firstElementChild /zh-CN/docs/orphaned/Web/API/ParentNode/firstElementChild +/zh-CN/docs/DOM/Element.lastElementChild /zh-CN/docs/orphaned/Web/API/ParentNode/lastElementChild /zh-CN/docs/DOM/Element.nextElementSibling /zh-CN/docs/Web/API/Element/nextElementSibling /zh-CN/docs/DOM/Element.querySelectorAll /zh-CN/docs/Web/API/Element/querySelectorAll /zh-CN/docs/DOM/EventTarget /zh-CN/docs/Web/API/EventTarget @@ -1726,10 +1726,12 @@ /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/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.firstElementChild /zh-CN/docs/orphaned/Web/API/ParentNode/firstElementChild +/zh-CN/docs/Web/API/ParentNode.lastElementChild /zh-CN/docs/orphaned/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/ParentNode/firstElementChild /zh-CN/docs/orphaned/Web/API/ParentNode/firstElementChild +/zh-CN/docs/Web/API/ParentNode/lastElementChild /zh-CN/docs/orphaned/Web/API/ParentNode/lastElementChild /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 16eb345f2b..917102ab9b 100644 --- a/files/zh-cn/_wikihistory.json +++ b/files/zh-cn/_wikihistory.json @@ -16794,29 +16794,6 @@ "ziyunfei" ] }, - "Web/API/ParentNode/firstElementChild": { - "modified": "2020-10-15T21:06:48.165Z", - "contributors": [ - "igoryaodev", - "imwangpan", - "gwh1312", - "RainSlide", - "xgqfrms-GitHub", - "teoli", - "AlexChao", - "ziyunfei" - ] - }, - "Web/API/ParentNode/lastElementChild": { - "modified": "2020-10-15T21:05:51.837Z", - "contributors": [ - "RainSlide", - "xgqfrms-GitHub", - "teoli", - "khalid32", - "ziyunfei" - ] - }, "Web/API/ParentNode/prepend": { "modified": "2020-10-15T21:52:00.307Z", "contributors": [ @@ -50798,5 +50775,28 @@ "ziyunfei", "AlexChao" ] + }, + "orphaned/Web/API/ParentNode/firstElementChild": { + "modified": "2020-10-15T21:06:48.165Z", + "contributors": [ + "igoryaodev", + "imwangpan", + "gwh1312", + "RainSlide", + "xgqfrms-GitHub", + "teoli", + "AlexChao", + "ziyunfei" + ] + }, + "orphaned/Web/API/ParentNode/lastElementChild": { + "modified": "2020-10-15T21:05:51.837Z", + "contributors": [ + "RainSlide", + "xgqfrms-GitHub", + "teoli", + "khalid32", + "ziyunfei" + ] } } \ No newline at end of file diff --git a/files/zh-cn/orphaned/web/api/parentnode/firstelementchild/index.html b/files/zh-cn/orphaned/web/api/parentnode/firstelementchild/index.html new file mode 100644 index 0000000000..8e658b4adc --- /dev/null +++ b/files/zh-cn/orphaned/web/api/parentnode/firstelementchild/index.html @@ -0,0 +1,96 @@ +--- +title: Element.firstElementChild +slug: orphaned/Web/API/ParentNode/firstElementChild +translation_of: Web/API/ParentNode/firstElementChild +original_slug: Web/API/ParentNode/firstElementChild +--- +

{{ APIRef("DOM") }}

+ +

ParentNode.firstElementChild 只读属性,返回对象的第一个子 {{domxref("元素")}}, 如果没有子元素,则为null。

+ +
+

他的属性最初是在{{domxref("element遍历")}}纯接口中定义的。由于这个接口包含两组不同的属性,一个针对具有子元素的{{domxref("Node")}},一个针对子元素的属性,因此它们被移动到两个单独的纯接口中,{{domxref("ParentNode")}}和{{domxref("ChildNode")}}。在本例中,firstElementChild移动到{{domxref("ParentNode")}}。这是一个相当技术性的更改,不应该影响兼容性。

+
+ +

语法

+ +
var element = node.firstElementChild;
+
+ +

例子

+ +
<ul id="foo">
+  <li>First  (1)</li>
+  <li>Second (2)</li>
+  <li>Third  (3)</li>
+</ul>
+
+<script>
+var foo = document.getElementById('foo');
+// yields: First  (1)
+console.log(foo.firstElementChild.textContent);
+</script>
+
+ +

适用于 IE8、IE9 和 Safari 的 Polyfill

+ +
// Overwrites native 'firstElementChild' prototype.
+// Adds Document & DocumentFragment support for IE9 & Safari.
+// Returns array instead of HTMLCollection.
+;(function(constructor) {
+    if (constructor &&
+        constructor.prototype &&
+        constructor.prototype.firstElementChild == null) {
+        Object.defineProperty(constructor.prototype, 'firstElementChild', {
+            get: function() {
+                var node, nodes = this.childNodes, i = 0;
+                while (node = nodes[i++]) {
+                    if (node.nodeType === 1) {
+                        return node;
+                    }
+                }
+                return null;
+            }
+        });
+    }
+})(window.Node || window.Element);
+ +

规范

+ + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('DOM WHATWG', '#dom-parentnode-firstelementchild', 'ParentNode.firstElementChild')}}{{Spec2('DOM WHATWG')}}Splitted the ElementTraversalinterface in {{domxref("ChildNode")}} and ParentNode. This method is now defined on the latter.
+ The {{domxref("Document")}} and {{domxref("DocumentFragment")}} implemented the new interfaces.
{{SpecName('Element Traversal', '#attribute-firstElementChild', 'ElementTraversal.firstElementChild')}}{{Spec2('Element Traversal')}}Added its initial definition to theElementTraversal pure interface and use it on {{domxref("Element")}}.
+ +

浏览器兼容性

+ + + +

{{Compat("api.ParentNode.firstElementChild")}}

+ +

参见

+ +

Ed

+ + diff --git a/files/zh-cn/orphaned/web/api/parentnode/lastelementchild/index.html b/files/zh-cn/orphaned/web/api/parentnode/lastelementchild/index.html new file mode 100644 index 0000000000..566d3a1976 --- /dev/null +++ b/files/zh-cn/orphaned/web/api/parentnode/lastelementchild/index.html @@ -0,0 +1,94 @@ +--- +title: Element.lastElementChild +slug: orphaned/Web/API/ParentNode/lastElementChild +translation_of: Web/API/ParentNode/lastElementChild +original_slug: Web/API/ParentNode/lastElementChild +--- +

{{ APIRef("DOM") }}

+ +

只读属性 ParentNode.lastElementChild 返回对象的最后一个子{{domxref("Element", "元素")}},如果没有子元素,则返回 null

+ +
+

This property was initially defined in the {{domxref("ElementTraversal")}} pure interface. As this interface contained two distinct set of properties, one aimed at {{domxref("Node")}} that have children, one at those that are children, they have been moved into two separate pure interfaces, {{domxref("ParentNode")}} and {{domxref("ChildNode")}}. In this case, lastElementChild moved to {{domxref("ParentNode")}}. This is a fairly technical change that shouldn't affect compatibility.

+
+ +

语法

+ +
var element = node.lastElementChild; 
+ +

例子

+ +
<ul id="foo">
+  <li>First  (1)</li>
+  <li>Second (2)</li>
+  <li>Third  (3)</li>
+</ul>
+
+<script>
+var foo = document.getElementById('foo');
+// yields: Third  (3)
+console.log(foo.lastElementChild.textContent);
+</script>
+
+ +

适用于 IE8、IE9 和 Safari 的 Polyfill

+ +
// Overwrites native 'lastElementChild' prototype.
+// Adds Document & DocumentFragment support for IE9 & Safari.
+// Returns array instead of HTMLCollection.
+;(function(constructor) {
+    if (constructor &&
+        constructor.prototype &&
+        constructor.prototype.lastElementChild == null) {
+        Object.defineProperty(constructor.prototype, 'lastElementChild', {
+            get: function() {
+                var node, nodes = this.childNodes, i = nodes.length - 1;
+                while (node = nodes[i--]) {
+                    if (node.nodeType === 1) {
+                        return node;
+                    }
+                }
+                return null;
+            }
+        });
+    }
+})(window.Node || window.Element);
+
+ +

规范

+ + + + + + + + + + + + + + + + + + + +
规范状态备注
{{SpecName('DOM WHATWG', '#dom-parentnode-lastelementchild', 'ParentNode.lastElementChild')}}{{Spec2('DOM WHATWG')}}Splitted the ElementTraversal interface in {{domxref("ChildNode")}} and ParentNode. This method is now defined on the latter.
+ The {{domxref("Document")}} and {{domxref("DocumentFragment")}} implemented the new interfaces.
{{SpecName('Element Traversal', '#attribute-lastElementChild', 'ElementTraversal.lastElementChild')}}{{Spec2('Element Traversal')}}Added its initial definition to the ElementTraversal pure interface and use it on {{domxref("Element")}}.
+ +

浏览器兼容性

+ + + +

{{Compat("api.ParentNode.lastElementChild")}}

+ +

参见

+ + diff --git a/files/zh-cn/web/api/parentnode/firstelementchild/index.html b/files/zh-cn/web/api/parentnode/firstelementchild/index.html deleted file mode 100644 index 1ff4b6f06f..0000000000 --- a/files/zh-cn/web/api/parentnode/firstelementchild/index.html +++ /dev/null @@ -1,95 +0,0 @@ ---- -title: Element.firstElementChild -slug: Web/API/ParentNode/firstElementChild -translation_of: Web/API/ParentNode/firstElementChild ---- -

{{ APIRef("DOM") }}

- -

ParentNode.firstElementChild 只读属性,返回对象的第一个子 {{domxref("元素")}}, 如果没有子元素,则为null。

- -
-

他的属性最初是在{{domxref("element遍历")}}纯接口中定义的。由于这个接口包含两组不同的属性,一个针对具有子元素的{{domxref("Node")}},一个针对子元素的属性,因此它们被移动到两个单独的纯接口中,{{domxref("ParentNode")}}和{{domxref("ChildNode")}}。在本例中,firstElementChild移动到{{domxref("ParentNode")}}。这是一个相当技术性的更改,不应该影响兼容性。

-
- -

语法

- -
var element = node.firstElementChild;
-
- -

例子

- -
<ul id="foo">
-  <li>First  (1)</li>
-  <li>Second (2)</li>
-  <li>Third  (3)</li>
-</ul>
-
-<script>
-var foo = document.getElementById('foo');
-// yields: First  (1)
-console.log(foo.firstElementChild.textContent);
-</script>
-
- -

适用于 IE8、IE9 和 Safari 的 Polyfill

- -
// Overwrites native 'firstElementChild' prototype.
-// Adds Document & DocumentFragment support for IE9 & Safari.
-// Returns array instead of HTMLCollection.
-;(function(constructor) {
-    if (constructor &&
-        constructor.prototype &&
-        constructor.prototype.firstElementChild == null) {
-        Object.defineProperty(constructor.prototype, 'firstElementChild', {
-            get: function() {
-                var node, nodes = this.childNodes, i = 0;
-                while (node = nodes[i++]) {
-                    if (node.nodeType === 1) {
-                        return node;
-                    }
-                }
-                return null;
-            }
-        });
-    }
-})(window.Node || window.Element);
- -

规范

- - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('DOM WHATWG', '#dom-parentnode-firstelementchild', 'ParentNode.firstElementChild')}}{{Spec2('DOM WHATWG')}}Splitted the ElementTraversalinterface in {{domxref("ChildNode")}} and ParentNode. This method is now defined on the latter.
- The {{domxref("Document")}} and {{domxref("DocumentFragment")}} implemented the new interfaces.
{{SpecName('Element Traversal', '#attribute-firstElementChild', 'ElementTraversal.firstElementChild')}}{{Spec2('Element Traversal')}}Added its initial definition to theElementTraversal pure interface and use it on {{domxref("Element")}}.
- -

浏览器兼容性

- - - -

{{Compat("api.ParentNode.firstElementChild")}}

- -

参见

- -

Ed

- - diff --git a/files/zh-cn/web/api/parentnode/lastelementchild/index.html b/files/zh-cn/web/api/parentnode/lastelementchild/index.html deleted file mode 100644 index 57481ff762..0000000000 --- a/files/zh-cn/web/api/parentnode/lastelementchild/index.html +++ /dev/null @@ -1,93 +0,0 @@ ---- -title: Element.lastElementChild -slug: Web/API/ParentNode/lastElementChild -translation_of: Web/API/ParentNode/lastElementChild ---- -

{{ APIRef("DOM") }}

- -

只读属性 ParentNode.lastElementChild 返回对象的最后一个子{{domxref("Element", "元素")}},如果没有子元素,则返回 null

- -
-

This property was initially defined in the {{domxref("ElementTraversal")}} pure interface. As this interface contained two distinct set of properties, one aimed at {{domxref("Node")}} that have children, one at those that are children, they have been moved into two separate pure interfaces, {{domxref("ParentNode")}} and {{domxref("ChildNode")}}. In this case, lastElementChild moved to {{domxref("ParentNode")}}. This is a fairly technical change that shouldn't affect compatibility.

-
- -

语法

- -
var element = node.lastElementChild; 
- -

例子

- -
<ul id="foo">
-  <li>First  (1)</li>
-  <li>Second (2)</li>
-  <li>Third  (3)</li>
-</ul>
-
-<script>
-var foo = document.getElementById('foo');
-// yields: Third  (3)
-console.log(foo.lastElementChild.textContent);
-</script>
-
- -

适用于 IE8、IE9 和 Safari 的 Polyfill

- -
// Overwrites native 'lastElementChild' prototype.
-// Adds Document & DocumentFragment support for IE9 & Safari.
-// Returns array instead of HTMLCollection.
-;(function(constructor) {
-    if (constructor &&
-        constructor.prototype &&
-        constructor.prototype.lastElementChild == null) {
-        Object.defineProperty(constructor.prototype, 'lastElementChild', {
-            get: function() {
-                var node, nodes = this.childNodes, i = nodes.length - 1;
-                while (node = nodes[i--]) {
-                    if (node.nodeType === 1) {
-                        return node;
-                    }
-                }
-                return null;
-            }
-        });
-    }
-})(window.Node || window.Element);
-
- -

规范

- - - - - - - - - - - - - - - - - - - -
规范状态备注
{{SpecName('DOM WHATWG', '#dom-parentnode-lastelementchild', 'ParentNode.lastElementChild')}}{{Spec2('DOM WHATWG')}}Splitted the ElementTraversal interface in {{domxref("ChildNode")}} and ParentNode. This method is now defined on the latter.
- The {{domxref("Document")}} and {{domxref("DocumentFragment")}} implemented the new interfaces.
{{SpecName('Element Traversal', '#attribute-lastElementChild', 'ElementTraversal.lastElementChild')}}{{Spec2('Element Traversal')}}Added its initial definition to the ElementTraversal pure interface and use it on {{domxref("Element")}}.
- -

浏览器兼容性

- - - -

{{Compat("api.ParentNode.lastElementChild")}}

- -

参见

- - diff --git a/files/zh-tw/_redirects.txt b/files/zh-tw/_redirects.txt index 24c794b2b8..49ffb976ba 100644 --- a/files/zh-tw/_redirects.txt +++ b/files/zh-tw/_redirects.txt @@ -577,6 +577,7 @@ /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/ParentNode/firstElementChild /zh-TW/docs/orphaned/Web/API/ParentNode/firstElementChild /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 f702d4e4df..e287862822 100644 --- a/files/zh-tw/_wikihistory.json +++ b/files/zh-tw/_wikihistory.json @@ -4233,12 +4233,6 @@ "jackblackevo" ] }, - "Web/API/ParentNode/firstElementChild": { - "modified": "2020-10-15T22:25:38.862Z", - "contributors": [ - "ianchen0119" - ] - }, "Web/API/PaymentRequest": { "modified": "2020-10-15T22:13:15.817Z", "contributors": [ @@ -9152,5 +9146,11 @@ "contributors": [ "jackblackevo" ] + }, + "orphaned/Web/API/ParentNode/firstElementChild": { + "modified": "2020-10-15T22:25:38.862Z", + "contributors": [ + "ianchen0119" + ] } } \ No newline at end of file diff --git a/files/zh-tw/orphaned/web/api/parentnode/firstelementchild/index.html b/files/zh-tw/orphaned/web/api/parentnode/firstelementchild/index.html new file mode 100644 index 0000000000..ca33d60793 --- /dev/null +++ b/files/zh-tw/orphaned/web/api/parentnode/firstelementchild/index.html @@ -0,0 +1,96 @@ +--- +title: ParentNode.firstElementChild +slug: orphaned/Web/API/ParentNode/firstElementChild +translation_of: Web/API/ParentNode/firstElementChild +original_slug: Web/API/ParentNode/firstElementChild +--- +

{{ APIRef("DOM") }}

+ +

ParentNode.firstElementChild 介面會會返回 ParentNode的第一個子元素(唯讀) ,如果該節點沒有子節點則返回null

+ +
+

This property was initially defined in the {{domxref("ElementTraversal")}} pure interface. As this interface contained two distinct set of properties, one aimed at {{domxref("Node")}} that have children, one at those that are children, they have been moved into two separate pure interfaces, {{domxref("ParentNode")}} and {{domxref("ChildNode")}}. In this case, firstElementChild moved to {{domxref("ParentNode")}}. This is a fairly technical change that shouldn't affect compatibility.

+
+ +

語法

+ +
var element = node.firstElementChild;
+
+ +

範例

+ +
<ul id="foo">
+  <li>First  (1)</li>
+  <li>Second (2)</li>
+  <li>Third  (3)</li>
+</ul>
+
+<script>
+var foo = document.getElementById('foo');
+// yields: First  (1)
+console.log(foo.firstElementChild.textContent);
+</script>
+
+ +

適用於IE8, IE9 和 Safari的Polyfill

+ +
// Overwrites native 'firstElementChild' prototype.
+// Adds Document & DocumentFragment support for IE9 & Safari.
+;(function(constructor) {
+    if (constructor &&
+        constructor.prototype &&
+        constructor.prototype.firstElementChild == null) {
+        Object.defineProperty(constructor.prototype, 'firstElementChild', {
+            get: function() {
+                var node, nodes = this.childNodes, i = 0;
+                while (node = nodes[i++]) {
+                    if (node.nodeType === 1) {
+                        return node;
+                    }
+                }
+                return null;
+            }
+        });
+    }
+})(window.Node || window.Element);
+
+ +

規範

+ + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('DOM WHATWG', '#dom-parentnode-firstelementchild', 'ParentNode.firstElementChild')}}{{Spec2('DOM WHATWG')}}Split the ElementTraversal interface in {{domxref("ChildNode")}} and ParentNode. This method is now defined on the latter.
+ The {{domxref("Document")}} and {{domxref("DocumentFragment")}} implemented the new interfaces.
{{SpecName('Element Traversal', '#attribute-firstElementChild', 'ElementTraversal.firstElementChild')}}{{Spec2('Element Traversal')}}Added its initial definition to the ElementTraversal pure interface and use it on {{domxref("Element")}}.
+ +

瀏覽器相容性

+ + + +

{{Compat("api.ParentNode.firstElementChild")}}

+ +

參見

+ + diff --git a/files/zh-tw/web/api/parentnode/firstelementchild/index.html b/files/zh-tw/web/api/parentnode/firstelementchild/index.html deleted file mode 100644 index 4fa9722123..0000000000 --- a/files/zh-tw/web/api/parentnode/firstelementchild/index.html +++ /dev/null @@ -1,95 +0,0 @@ ---- -title: ParentNode.firstElementChild -slug: Web/API/ParentNode/firstElementChild -translation_of: Web/API/ParentNode/firstElementChild ---- -

{{ APIRef("DOM") }}

- -

ParentNode.firstElementChild 介面會會返回 ParentNode的第一個子元素(唯讀) ,如果該節點沒有子節點則返回null

- -
-

This property was initially defined in the {{domxref("ElementTraversal")}} pure interface. As this interface contained two distinct set of properties, one aimed at {{domxref("Node")}} that have children, one at those that are children, they have been moved into two separate pure interfaces, {{domxref("ParentNode")}} and {{domxref("ChildNode")}}. In this case, firstElementChild moved to {{domxref("ParentNode")}}. This is a fairly technical change that shouldn't affect compatibility.

-
- -

語法

- -
var element = node.firstElementChild;
-
- -

範例

- -
<ul id="foo">
-  <li>First  (1)</li>
-  <li>Second (2)</li>
-  <li>Third  (3)</li>
-</ul>
-
-<script>
-var foo = document.getElementById('foo');
-// yields: First  (1)
-console.log(foo.firstElementChild.textContent);
-</script>
-
- -

適用於IE8, IE9 和 Safari的Polyfill

- -
// Overwrites native 'firstElementChild' prototype.
-// Adds Document & DocumentFragment support for IE9 & Safari.
-;(function(constructor) {
-    if (constructor &&
-        constructor.prototype &&
-        constructor.prototype.firstElementChild == null) {
-        Object.defineProperty(constructor.prototype, 'firstElementChild', {
-            get: function() {
-                var node, nodes = this.childNodes, i = 0;
-                while (node = nodes[i++]) {
-                    if (node.nodeType === 1) {
-                        return node;
-                    }
-                }
-                return null;
-            }
-        });
-    }
-})(window.Node || window.Element);
-
- -

規範

- - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('DOM WHATWG', '#dom-parentnode-firstelementchild', 'ParentNode.firstElementChild')}}{{Spec2('DOM WHATWG')}}Split the ElementTraversal interface in {{domxref("ChildNode")}} and ParentNode. This method is now defined on the latter.
- The {{domxref("Document")}} and {{domxref("DocumentFragment")}} implemented the new interfaces.
{{SpecName('Element Traversal', '#attribute-firstElementChild', 'ElementTraversal.firstElementChild')}}{{Spec2('Element Traversal')}}Added its initial definition to the ElementTraversal pure interface and use it on {{domxref("Element")}}.
- -

瀏覽器相容性

- - - -

{{Compat("api.ParentNode.firstElementChild")}}

- -

參見

- - -- cgit v1.2.3-54-g00ecf