(e)
| 12 | let myLibrary = []; |
| 13 | //Adding a new Book |
| 14 | const addBook = (e) => { |
| 15 | let title = document.getElementById("title"); |
| 16 | let author = document.getElementById("author"); |
| 17 | const isRead = document.getElementById("read-status").value; |
| 18 | if(title.value !== "" && author.value!== ""){ |
| 19 | myLibrary.push(new Book(title.value,author.value,isRead)); |
| 20 | displayBooks(); |
| 21 | title.value = ""; |
| 22 | author.value = ""; |
| 23 | } |
| 24 | } |
| 25 | //Add button eventListener |
| 26 | const addBookBtn = document.getElementById("add"); |
| 27 | addBookBtn.onclick = (e) => { |
no test coverage detected