We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2863385 commit 3e548bdCopy full SHA for 3e548bd
2 files changed
app.js
@@ -32,4 +32,14 @@ addForm.addEventListener('submit', function(e){
32
li.appendChild(bookName);
33
li.appendChild(deleteBtn);
34
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
+ }
45
});
index.html
@@ -39,6 +39,8 @@ <h2 class="title">Books to Read</h2>
</ul>
</div>
<form id="add-book">
+ <input type="checkbox" id="hide" />
+ <label for="hide">Hide all books</label>
<input type="text" placeholder="Add a book..." />
<button>Add</button>
46
</form>
0 commit comments