<!DOCTYPE html> <html> <head> <title>Teachsomebody</title> <script> document.body.innerHTML = "<p>I am legend by Will</p>" </script> </head> <body> </body> </html>
This will output 'I am legend' within a paragraph on the HTML page.
The script tags and code could also be moved into the body tags to produce the same output.
document.body.innerHTML = "<p>I am legend by Will</p>"
HTML document referencing the external test.js script (assuming test.js is in the same directory as the HTML document)
This will produce the same effect as the inline code in the earlier example.