function deleteParentNodeOnClick() { for (var i = 0; i < deleteButton.length; i++) { deleteButton[i].addEventListener("click", deleteNodeOnClick); }