From 26faaacdb73a636915aada6012b94f0620f754b1 Mon Sep 17 00:00:00 2001 From: Alexander Date: Thu, 30 Nov 2017 19:00:59 +0300 Subject: [PATCH] Update solution.md --- .../04-searching-elements-dom/2-tree-info/solution.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2-ui/1-document/04-searching-elements-dom/2-tree-info/solution.md b/2-ui/1-document/04-searching-elements-dom/2-tree-info/solution.md index 5bb2effa..781b7a92 100644 --- a/2-ui/1-document/04-searching-elements-dom/2-tree-info/solution.md +++ b/2-ui/1-document/04-searching-elements-dom/2-tree-info/solution.md @@ -1,7 +1,7 @@ Let's make a loop over `
  • `: ```js -for (let li of document.querySelector('li')) { +for (let li of document.querySelectorAll('li')) { ... } ``` @@ -9,7 +9,7 @@ for (let li of document.querySelector('li')) { In the loop we need to get the text inside every `li`. We can read it directly from the first child node, that is the text node: ```js -for (let li of document.querySelector('li')) { +for (let li of document.querySelectorAll('li')) { let title = li.firstChild.data; // title is the text in
  • before any other nodes