forked from iamshaunjp/JavaScript-DOM-Tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
25 lines (20 loc) · 635 Bytes
/
app.js
File metadata and controls
25 lines (20 loc) · 635 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
let h2 = document.querySelector('#book-list h2')
// console.log(h2)
// h2.addEventListener('click', function(e){
// console.log(e.target)
// console.log(e)
// })
let deleButtons = Array.from(document.querySelectorAll('#book-list .delete'))
console.log(deleButtons)
deleButtons.forEach((button) => {
button.addEventListener('click', (e) => {
const li = e.target.parentElement
li.parentNode.removeChild(li)
})
});
let clickHere = document.querySelector('#page-banner a')
// console.log(clickHere)
clickHere.addEventListener('click', (e) => {
e.preventDefault()
console.log('navt to', e.target.textContent)
} )