Skip to content

Commit c779159

Browse files
Shaun PellingShaun Pelling
authored andcommitted
lesson 6 code
1 parent aa36d97 commit c779159

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

app.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
const books = document.querySelectorAll('#book-list li .name');
1+
const banner = document.querySelector('#page-banner');
22

3-
Array.from(books).forEach(function(book){
4-
book.textContent += ' (Book title)';
5-
});
3+
console.log('#page-banner node type is:', banner.nodeType);
4+
console.log('#page-banner node name is:', banner.nodeName);
5+
console.log('#page-banner has child nodes:', banner.hasChildNodes());
66

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>';
7+
const clonedBanner = banner.cloneNode(true);
8+
console.log(clonedBanner);

0 commit comments

Comments
 (0)