Write HTML elements with text directly to the HTML document:
document.write("<h1>Hello World!</h1><p>Have a nice day!</p>");
<!DOCTYPE html> <html> <body> <script> document.write("<h1>Hello World!</h1><p>Have a nice day!</p>"); </script>/*w w w .ja v a 2 s .com*/ </body> </html>