<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div>one</div>
<div>
two
<div>three</div>
</div>
<div>four</div>
<script>
Array.prototype.slice.call(document.getElementsByTagName('div')).forEach(function(item) {
item.parentNode.removeChild(item);
} );
</script>
</body>
</html>