What's wrong with this code?
div.removeChild()
document.removeChild()
It calls div.removeChild() with a tag name, not an element.