Skip to content

Commit 3e548bd

Browse files
committed
15 Lesson
1 parent 2863385 commit 3e548bd

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

app.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,14 @@ addForm.addEventListener('submit', function(e){
3232
li.appendChild(bookName);
3333
li.appendChild(deleteBtn);
3434
list.appendChild(li);
35+
});
36+
37+
// hide books
38+
const hideBox = document.querySelector('#hide')
39+
hideBox.addEventListener('change', function(e){
40+
if(hideBox.checked){
41+
list.style.display = "none";
42+
} else {
43+
list.style.display = "initial";
44+
}
3545
});

index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ <h2 class="title">Books to Read</h2>
3939
</ul>
4040
</div>
4141
<form id="add-book">
42+
<input type="checkbox" id="hide" />
43+
<label for="hide">Hide all books</label>
4244
<input type="text" placeholder="Add a book..." />
4345
<button>Add</button>
4446
</form>

0 commit comments

Comments
 (0)