xxxxxxxxxx
var x = document.getElementById("ID").parentElement.nodeName;
xxxxxxxxxx
var parent = element.parentElement;
//OR
e.target.parentNode //target parent
<div>
<span onclick="this.parentElement.style.display = 'none';">x</span>
</div>
xxxxxxxxxx
// Get the parent element of a specific element
const element = document.querySelector('#elementId'); // Replace 'elementId' with the actual ID of the element
const parentElement = element.parentElement;
xxxxxxxxxx
// Assuming 'element' is the reference to the element for which we want to find the parent
const parentElement = element.parentElement;