Home > Article > Web Front-end > In-depth explanation of document.write() and unpaired tags of HTML4.01_Basic knowledge
(1) Non-paired tags in HTML4.01:
Comment tag:
Strictly speaking, it is not an HTML tag: Document declaration tag
Set page meta information: tag
Set the relative directory (such as the root directory) of all links on the web page:
Line break:
Horizontal line:
Image:
Form element
Defines the attributes of one or more columns in the table:
Defines the frame of a window: tag
Defines the relationship between the document and external resources: Link tag
【Results from querying W3School】
(2) document.write()
1. This method is part of level 0 DON. Calling this method will create a new output stream with the content as the parameter;
2. When called at the top level of the script element, that is, when called outside the window.onload event handle or the defer function, this method will output the content when the parser parses it. Previous documents will not be overwritten at this time.
3. When called in the window.onload event handle or defer function, the content output by this method will overwrite the current document stream. The previous document will be overwritten at this time.
4. When this method is called continuously, the output content is in the same output stream. When the output stream document.close() is closed before calling this method, this method will overwrite the document stream before closing. The document.open() method creates a new output stream, overwriting the previous document stream.