onlickusername
New Coder
JavaScript:
function deleteTodo(event) {
const deleteButton = event.target;
const idToDelete = deleteButton.id;
todos.filter(function (todo) {
if (todo.id === idToDelete) {
return false;
} else {
return true;
}
});
render();
};
function render() {
todos.forEach(function (todo) {
const deleteButton = document.createElement('button');
deleteButton.onlick = deleteTodo;
}
}