I have this script:
var text = ["Ground Beef", "Spaghetti", "Tomatoes", "Onions", "Cheese"];
text.forEach(function(el) {
var div = document.createElement("p");
div.className = "list";
div.innerHTML = el;
document.body.appendChild(div);
});
Please let me know how to add on click function to delete each for this elements Ground Beef ....