Got this ToDoList app
All good, but after I insert a new activity (a new table) the buttons are not responsive even though I give them the classes and trigger the eventListener
s.
Atm, my DOM consts are at the top of the JS page, but even when I moved them after the insertion of a new table (activity) in the JS page, still doesn't work.
tldr:
- remove and check buttons work with html that is preset on the page;
- remove and check buttons don't work with html that is inserted with js
newDiv.innerHTML = `<table class="table table-dark">
<thead>
<tr>
<th scope="col">Title</th>
<th scope="col">Priority</th>
<th scope="col">Description</th>
<th scope="col">Date</th>
<th scope="col">Tasks</th>
<th scope="col">Completed</th>
<th scope="col">Remove</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">${newActivity.title}</th>
<td>${newActivity.priority}</td>
<td>${newActivity.description}</td>
<td>${newActivity.date}</td>
<td><i class="fas fa-sitemap"></i></td>
<td><span class ='check-button'>X</span></td>
<td><i class="fas fa-archive remove-button"></i></td>
</tr>
</tbody>
</table>`;