Merge pull request #315 from usernamehw/patch-3

Update solution.md
This commit is contained in:
Ilya Kantor 2017-12-16 11:25:12 +03:00 committed by GitHub
commit be108af763
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,7 @@
Let's make a loop over `<li>`:
```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 <li> before any other nodes