Javascript examples for DOM:Document write
The write() method writes HTML expressions or JavaScript code to a document.
document.write(exp1, exp2, exp3, ...);
Parameter | Description |
---|---|
exp1, exp2, exp3, ... | Optional. arguments to be appended to the document in order of occurrence |
No return value
The following code shows how to Write some text directly to the HTML document:
<!DOCTYPE html> <html> <body> <pre> <script> document.write("Hello World!"); document.write("Have a nice day!"); </script>//from ww w. j a v a 2 s .c o m </pre> </body> </html>