Skip to content

Commit a8ac07b

Browse files
author
vavimayor159
committed
Revision de snippets de codigo
1 parent ac7aec1 commit a8ac07b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

14_dom.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ atributo `id` y usar `document.getElementById`.
305305

306306
```{lang: "text/html"}
307307
<p>Mi avestruz Gertrudiz:</p>
308-
<p><img id="gertrudiz" src="img/avestruz.png"></p>
308+
<p><img id="gertrudiz" src="img/ostrich.png"></p>
309309
310310
<script>
311311
let avestruz = document.getElementById("gertrudiz");
@@ -417,7 +417,7 @@ tiempo real, puedes convertir la colección a un arreglo real llamando
417417
`Array.from`.
418418

419419
```
420-
let casi_arreglo = {0: "one", 1: "two", length: 2};
420+
let casi_arreglo = {0: "uno", 1: "dos", length: 2};
421421
let arreglo = Array.from(casi_arreglo);
422422
console.log(arreglo.map(s => s.toUpperCase()));
423423
// → ["UNO", "DOS"]
@@ -495,10 +495,10 @@ nodo del elemento. En vez de eso, tendrás que utilizar los métodos
495495
<p data-classified="no-classificado">Yo tengo dos pies.</p>
496496
497497
<script>
498-
let paras = document.body.getElementsByTagName("p");
499-
for (let para of Array.from(paras)) {
500-
if (para.getAttribute("data-classified") == "secreto") {
501-
para.remove();
498+
let parrafos = document.body.getElementsByTagName("p");
499+
for (let parrafo of Array.from(parrafos)) {
500+
if (parrafo.getAttribute("data-classified") == "secreto") {
501+
parrafo.remove();
502502
}
503503
}
504504
</script>
@@ -557,9 +557,9 @@ del espacio _dentro_ del elemento, ignorando la anchura del borde.
557557
</p>
558558
559559
<script>
560-
let para = document.body.getElementsByTagName("p")[0];
561-
console.log("clientHeight:", para.clientHeight);
562-
console.log("offsetHeight:", para.offsetHeight);
560+
let parrafo = document.body.getElementsByTagName("p")[0];
561+
console.log("clientHeight:", parrafo.clientHeight);
562+
console.log("offsetHeight:", parrafo.offsetHeight);
563563
</script>
564564
```
565565

0 commit comments

Comments
 (0)