I'm having a problem with my javascript. I want to create some kind of to-do list but I can't figure out how to delete an item.
When creating an item, it adds to the list with a delete button, but I don't know what to do for the item to delete itself when clicking on the button.
I have this on the addItem function
var item = document.createElement("li");
item.innerHTML = itemText + "<button class='delete'>Delete item</button>";
list.appendChild(item);
And this would be the function to delete the item, but I don't know what to put inside ...
function deleteItem() {
}