英[raɪt] 美[raɪt]
vt.& vi.write; write; write; compose
Third person singular: writes present participle: writing past tense: wrote past participle: written
javascript write() method syntax
Function:Write HTML expressions or JavaScript code to the document.
Syntax: document.write(exp1,exp2,exp3,....)
Description: Although according to the DOM standard , this method only accepts a single string as parameter. But as a rule of thumb, write() can accept any number of arguments. We usually use the write() method in two ways: one is to use this method to output HTML in the document, and the other is to generate it in a window or frame other than the window in which the method is called. New document. In the second case, be sure to use the close() method to close the document.
javascript write() method example
<html> <body> <script type="text/javascript"> document.write("<h1>Hello World!</h1>") </script> </body> </html>
Run instance »
Click the "Run instance" button to view the online instance