var elem = document.querySelector('#some-element');
elem.parentNode.removeChild(elem);
node.remove();
// select the target element
const e = document.querySelector("li:last-child");
// remove the list item
e.parentElement.removeChild(e);
Code language: JavaScript (javascript)