Skip to content

Commit a9eb0d5

Browse files
committed
Books JS (5 Lesson)
1 parent 95cbdbf commit a9eb0d5

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

app.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
const wmf = document.querySelector('#book-list li:nth-child(2) .name');
2-
console.log(wmf);
1+
const books = document.querySelectorAll('#book-list li .name');
32

4-
var books = document.querySelector('#book-list li .name');
5-
console.log(books);
3+
Array.from(books).forEach(function(book){
4+
book.textContent += ' (Book title)';
5+
});
66

7-
books = document.querySelectorAll('#book-list li .name');
8-
console.log(books);
9-
10-
Array.from(books).forEach(function(book){
11-
console.log(book);
12-
});
7+
const bookList = document.querySelector('#book-list');
8+
bookList.innerHTML = '<h2>Books and more books...</h2>';
9+
bookList.innerHTML += '<p>This is how you add HTML content</p>';

0 commit comments

Comments
 (0)