Skip to content

Commit 5dc8cb2

Browse files
Shaun PellingShaun Pelling
authored andcommitted
lesson 10 code
1 parent d92c806 commit 5dc8cb2

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

app.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
11
const list = document.querySelector('#book-list ul');
22

3+
// delete books
34
list.addEventListener('click', (e) => {
45
if(e.target.className == 'delete'){
56
const li = e.target.parentElement;
6-
console.log('child element to remove:', li);
7-
console.log('parent element to remove child from:', li.parentElement);
87
li.parentNode.removeChild(li);
98
}
109
});
11-
12-
// prevent default behaviour
13-
14-
const link = document.querySelector('#page-banner a');
15-
16-
link.addEventListener('click', function(e){
17-
e.preventDefault();
18-
console.log('Navigation to', e.target.textContent, 'was prevented');
19-
});

index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
<div id="page-banner">
1212
<h1 class="title">Bookorama</h1>
1313
<p>Books for Ninjas</p>
14-
<a href="http://www.thenetninja.co.uk">Net Ninja Site</a>
1514
<form id="search-books">
1615
<input type="text" placeholder="Search books..." />
1716
</form>

0 commit comments

Comments
 (0)