In order to put JavaScript in a HTML document place the code in script tags. These tags can be included in the HEAD section of the HTML document, or in the BODY.
Often, scripts are placed at the very bottom of the page to enhance search engine optimization (SEO).
window.alert("This is a sample document!")
sample text sample text
sample text sample text