You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 2-ui/1-document/05-basic-dom-node-properties/2-lastchild-nodetype-inline/solution.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
There's a catch here.
1
+
C'è un tranello in questo esercizio.
2
2
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.
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"`.
0 commit comments