Skip to content

Commit afae57d

Browse files
the render function was the issue.
1 parent 3c360ff commit afae57d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

debugging/book-library/script.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ function render() {
9090

9191
//add delete button to every row and render again
9292
let delButton = document.createElement("button");
93-
delBut.id = i + 5;
94-
deleteCell.appendChild(delBut);
95-
delBut.className = "btn btn-warning";
96-
delBut.innerHTML = "Delete";
97-
delBut.addEventListener("clicks", function () {
93+
delButton.id = i + 5;
94+
deleteCell.appendChild(delButton);
95+
delButton.className = "btn btn-warning";
96+
delButton.innerHTML = "Delete";
97+
delButton.addEventListener("click", function () {
9898
alert(`You've deleted title: ${myLibrary[i].title}`);
9999
myLibrary.splice(i, 1);
100100
render();

0 commit comments

Comments
 (0)