My personal understanding is that when an event containing document.write() is triggered, the elements in the body of the HTML page will disappear and the content in document.write() will be displayed. For example, the following code:
<p>我的第一个段落</p> <button onclick="changeP()">点击<button> function changeP(){ docume
After clicking OK, the content in the label p and button disappears, and the current date is displayed on the page.
The above is the detailed content of JS: executing document.write after the document has finished loading, the entire HTML page will be overwritten. For more information, please follow other related articles on the PHP Chinese website!