var test=document.getElementsByTagName('html')[0].innerHTML; alert(test); 转载于:https://www.cnblogs.com/hailexuexi/p/5318255.html