diff --git a/2-ui/1-document/03-dom-navigation/1-dom-children/solution.md b/2-ui/1-document/03-dom-navigation/1-dom-children/solution.md index 3e3922c3cd..3070553be8 100644 --- a/2-ui/1-document/03-dom-navigation/1-dom-children/solution.md +++ b/2-ui/1-document/03-dom-navigation/1-dom-children/solution.md @@ -1,13 +1,13 @@ -这里有很多方法,比方说: +这里有很多种方法,例如: 获取 `
` DOM 节点: ```js document.body.firstElementChild -// 或者 +// 或 document.body.children[0] -// 或者(第一个节点是空格,所有我们拿第二个) +// 或(第一个节点是空格,所以我们应该获取的是第二个) document.body.childNodes[1] ``` @@ -15,13 +15,13 @@ document.body.childNodes[1] ```js document.body.lastElementChild -// 或者 +// 或 document.body.children[1] ``` -获取第二个 `
  • `(即包含 Pete 的节点) +获取第二个 `
  • `(即包含 Pete 的节点): ```js -// 获取