Remove all content using pure JS

前端 未结 9 2386
南方客
南方客 2020-12-03 09:56

I\'m looking for a way to remove the entire content of a web page using pure Javascript -- no libraries.

I tried:

document.documentElement.innerHTML          


        
9条回答
  •  执念已碎
    2020-12-03 10:58

    After the page has already fully loaded:

    document.write('');
    document.close();
    

提交回复
热议问题