function deleteParentNodeOnClick() { for (var i = 0; i < deleteButton.length; i++) { deleteButton[i].addEventListener("click", deleteNodeOnClick); } } function deleteNodeOnClick(e) { var trash = document.querySelectorAll("i"); for (var ind = 0; ind < trash.length; ind++) { console.log(e); this.parentNode.parentNode.remove(); } }
2.1m questions
2.1m answers
60 comments
57.0k users