Skip to content

Commit 47fc064

Browse files
committed
lesson 7
1 parent 62fb06b commit 47fc064

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

app.js

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
1-
const banner = document.querySelector('#page-banner');
1+
const bookList = document.querySelector('#book-list');
22

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());
3+
console.log('book list parent element:', bookList.parentElement);
4+
console.log('book list parent node:', bookList.parentNode);
65

7-
const clonedBanner = banner.cloneNode(true);
8-
console.log(clonedBanner);
6+
console.log('all node children:');
7+
Array.from(bookList.childNodes).forEach(function(node){
8+
console.log(node);
9+
});
10+
11+
console.log('all element children:');
12+
Array.from(bookList.children).forEach(function(node){
13+
console.log(node);
14+
});
15+
16+
const titles = bookList.querySelectorAll('.name');
17+
18+
console.log('Book titles:');
19+
Array.from(titles).forEach(function(title){
20+
console.log(title.textContent);
21+
});

0 commit comments

Comments
 (0)