blob: 0228c3264ccf847aae7dbc4c3499bf86954958ad (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
---
title: Node.lastChild
slug: Web/API/Node/lastChild
tags:
- API
- DOM
- NecesitaCompatibilidadNavegador
- Propiedad
- Referencia
translation_of: Web/API/Node/lastChild
---
<div>{{APIRef("DOM")}}</div>
<p>La propiedad de sólo lectura <code><strong>Node.lastChild</strong></code> devuelve el último hijo del nodo. Si su padre es un elemento, entonces el hijo es generalmente un nodo de element, nodo de texto o un nodo de comentario. Devuelve <code>null</code> si no hay elementos hijos.</p>
<h2 id="Sintaxis">Sintaxis</h2>
<pre class="syntaxbox">var <em>nodoHijo</em>= <var>nodo</var>.lastChild;
</pre>
<h2 id="Ejemplo">Ejemplo</h2>
<pre class="brush: js">var tr = document.getElementById("row1");
var corner_td = tr.lastChild;
</pre>
<h2 id="Especificaciones">Especificaciones</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">Especificación</th>
<th scope="col">Estado</th>
<th scope="col">Comentario</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName('DOM WHATWG', '#dom-node-lastchild', 'Node.lastChild')}}</td>
<td>{{Spec2('DOM WHATWG')}}</td>
<td>Sin cambio</td>
</tr>
<tr>
<td>{{SpecName('DOM3 Core', 'core.html#ID-61AD09FB', 'Node.lastChild')}}</td>
<td>{{Spec2('DOM3 Core')}}</td>
<td>Sin cambio</td>
</tr>
<tr>
<td>{{SpecName('DOM2 Core', 'core.html#ID-61AD09FB', 'Node.lastChild')}}</td>
<td>{{Spec2('DOM2 Core')}}</td>
<td>Sin cambio</td>
</tr>
<tr>
<td>{{SpecName('DOM1', 'level-one-core.html#ID-61AD09FB', 'Node.lastChild')}}</td>
<td>{{Spec2('DOM1')}}</td>
<td>Definición inicial</td>
</tr>
</tbody>
</table>
<h2 id="Compatibilidad_en_navegador">Compatibilidad en navegador</h2>
<p>{{Compat("api.Node.lastChild")}}</p>
|