Can you provide guidance on how to remove the top-level parent element of a div? I've been attempting to delete the main parent element of a specific div.
element.innerHTML = `
<div class="postIt-item">
<div class="postIt-item-btn-container">
<button class="btn-delete" type="button"><i class="fa fa-trash" aria-hidden="true></i></button>
<button class="btn-edit" type="button"><i class="fa fa-pencil" aria-hidden="true></i></button>
</div>
<p> ${value}</p>
<div> `
const deletebtn = element.querySelector('.btn-delete');
deletebtn.addEventListener('click', deleteItem);
//delete function
function deleteItem(e) {
const element = e.currentTarget.parentElement.parentElement;
e.parentElement.remove(); //
}