Remove an element

1. Use the remove method

Note that the remove method isn't supported in Internet Explorer.
ele.remove();

2. Use the removeChild method

if (ele.parentNode) {
ele.parentNode.removeChild(ele);
}

See also