Hello guys my first post on this forum not sure about the rule. I am trying to create a to do app. so far i am able to add item but i dont how to remove an specific item of my list
function createlist(){
var li = document.createElement("li");
var bt = document.createElement("button");
bt.appendChild(document.createTextNode("X"));
li.appendChild(document.createTextNode(input.value));
ul.appendChild(li);
ul.appendChild(bt);
bt.addEventListener("click",function(){
let item = this.parentElement;
item.style.display = "none";
});
The above code hide the entire list but i want to hide the specific list. I would also like to know how can i delete the item insted of hiding the element