Skip to content

Commit 8d2ec2d

Browse files
committed
Update 2-ui/1-document/05-basic-dom-node-properties
1 parent 2cc8457 commit 8d2ec2d

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

2-ui/1-document/05-basic-dom-node-properties/2-lastchild-nodetype-inline/solution.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
There's a catch here.
1+
C'è un tranello in questo esercizio.
22

3-
At the time of `<script>` execution the last DOM node is exactly `<script>`, because the browser did not process the rest of the page yet.
3+
Al momento dell'esecuzione di `<script>` l'ultimo nodo del DOM è esattamente `<script>`, dal momento che il browser non ha ancora elaborato il resto della pagina.
44

5-
So the result is `1` (element node).
5+
Pertanto il risultato è `1` (nodo elemento).
66

77
```html run height=60
88
<html>

2-ui/1-document/05-basic-dom-node-properties/2-lastchild-nodetype-inline/task.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
importance: 5
1+
importanza: 5
22

33
---
44

5-
# What's in the nodeType?
5+
# Cosa contiene nodeType?
66

7-
What does the script show?
7+
Cosa mostrerà lo script?
88

99
```html
1010
<html>

2-ui/1-document/05-basic-dom-node-properties/2-tree-info/task.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Abbiamo un alberatura HTML strutturata come un elenco di `ul/li` annidati.
88

99
Scrivete il codice che per ogni elemento `<li>` mostri:
1010

11-
1. Qual è il testo al suo interno (senza considerare l'eventuale sottostruttura)
11+
1. Qual è il testo al suo interno (senza considerare il testo di eventuali elementi `<li>` discendenti).
1212
2. Il numero degli elementi `<li>` annidati -- tutti i discendenti, considerando tutti i livelli di annidamento.
1313

1414
[demo src="solution"]
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The answer: **`BODY`**.
1+
Risposta: **`BODY`**.
22

33
```html run
44
<script>
@@ -10,8 +10,8 @@ The answer: **`BODY`**.
1010
</script>
1111
```
1212

13-
What's going on step by step:
13+
Cosa succede passo dopo passo:
1414

15-
1. The content of `<body>` is replaced with the comment. The comment is `<!--BODY-->`, because `body.tagName == "BODY"`. As we remember, `tagName` is always uppercase in HTML.
16-
2. The comment is now the only child node, so we get it in `body.firstChild`.
17-
3. The `data` property of the comment is its contents (inside `<!--...-->`): `"BODY"`.
15+
1. Il contenuto di `<body>` è rimpiazzato con il commento. Il commento è `<!--BODY-->`, poiché `body.tagName == "BODY"`. Abbiamo detto che, `tagName` è sempre maiuscolo in modalità HTML.
16+
2. Il commento è ora l'unico nodo figlio, perciò è il risultato di `body.firstChild`.
17+
3. La proprietà `data` del commento è il suo contenuto (ovvero ciò che è dentro i tag di apertura e chiusura `<!--...-->`): `"BODY"`.

2-ui/1-document/05-basic-dom-node-properties/3-tag-in-comment/task.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ importance: 3
22

33
---
44

5-
# Tag in comment
5+
# Tag nel commento
66

7-
What does this code show?
7+
Cosa mostrerà questo codice?
88

99
```html
1010
<script>
1111
let body = document.body;
1212
1313
body.innerHTML = "<!--" + body.tagName + "-->";
1414
15-
alert( body.firstChild.data ); // what's here?
15+
alert( body.firstChild.data ); // cosa c'è qui?
1616
</script>
1717
```

0 commit comments

Comments
 (0)