var parent = element.parentElement; //OR e.target.parentNode //target parent <div> <span onclick="this.parentElement.style.display = 'none';">x</span> </div>