A simple solution would be
document.body.innerHTML = "";
But why do you want to do this?
By the way:
var e = document.getElementsByTag('html');
it should be
var e = document.getElementsByTagName('html')[0];
and
e.removeChild('body');
it should be
e.removeChild(document.body);
source share