File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed
Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -33,3 +33,13 @@ addForm.addEventListener('submit', function(e){
3333 li . appendChild ( deleteBtn ) ;
3434 list . appendChild ( li ) ;
3535} ) ;
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+ } ) ;
Original file line number Diff line number Diff line change @@ -38,10 +38,11 @@ <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 >
44-
4546 </ div >
4647 < script src ="app.js "> </ script >
4748 </ body >
Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ h1, h2{
9191 box-sizing : border-box;
9292 width : 300px ;
9393 float : left;
94+ clear : both;
9495}
9596
9697# add-book button {
@@ -115,6 +116,14 @@ h1, h2{
115116 clear : both;
116117}
117118
119+ # add-book # hide {
120+ width : 30px ;
121+ }
122+
123+ # add-book label {
124+ line-height : 52px ;
125+ }
126+
118127/*
119128#tabbed-content li{
120129 display: inline-block;
You can’t perform that action at this time.
0 commit comments