javascript write() method
Translation results:
英[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() methodsyntax
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() methodexample
<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
Popular Recommendations
- How to Write a Custom Comparator Function in Java?
- Write less CSS using :is(), :where(), and :has() pseudo-classes
- How to Write Clean Code in Python - Best Practices Guide
- Write to Google Sheets from a local script via gcloud CLI authentication
- Microsoft Edge Can't Read and Write to Its Data Directory: Fixed