<html>
<div class = "div1">
I'm DIV1
</div>
<button>Click</button>
</html>
<script src = "84.js"></script>
document.getElementsByTagName('button')[0].onclick = a;
function a(){
var elem = document.getElementsByClassName('div1')[0];
elem.remove();
elem = document.getElementsByClassName('div1')[0];
if (!elem) {
alert('elem has been removed');
}else{}
}