Skip to content

Commit 8119d4f

Browse files
committed
15 lesson
1 parent 64d6176 commit 8119d4f

3 files changed

Lines changed: 20 additions & 1 deletion

File tree

app.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,17 @@ addForm.addEventListener('submit', function(e){
3232
li.appendChild(bookName);
3333
li.appendChild(deleteBtn);
3434
list.appendChild(li);
35-
3635

3736

37+
38+
});
39+
40+
//hide books
41+
const hideBox = document.querySelector('#hide')
42+
hideBox.addEventListener('change', function(e){
43+
if(hideBox.checked){
44+
list.style.display = "none";
45+
}else{
46+
list.style.display = "initial";
47+
}
3848
});

index.html

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

styles.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,13 @@ h1, h2{
115115
clear: both;
116116
}
117117

118+
#add-book #hide{
119+
width: 30px;
120+
}
121+
122+
#add-book #label{
123+
line-height: 52px;
124+
}
118125
/*
119126
#tabbed-content li{
120127
display: inline-block;

0 commit comments

Comments
 (0)