title: How to get JavaScript to display in my browser
body: <p>After extensively studying HTML &amp; CSS, I've just started to learn JavaScript &amp; Python. This is about JavaScript. I'm following a book asking me to start a 'script' tag within a 'div' element which itself is within the 'body' section of a new HTML document. I'm using Notepad++, but I've also tried this on Trinket.io but so far the JavaScript will just not display when I 'run' the document within my browser. The 'script' was at the end of the 'body' section of the document, until I changed it to the end of the 'head' section to see if that would work, but unfortunately it just won't display the results within the browser. I would appreciate any help with this.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en-GB"&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;title&gt;JavaScript No.1&lt;/title&gt;
  &lt;style&gt;
  #container {
   width: 800px;
   height: auto;
   margin-left: auto;
   margin-right: auto;
   font-family: garamond, serif;
   font-size: 16px;
   }
  
  h1 {
   text-align: center;
   }
  
  p {
   text-align: justify;
   }
  &lt;/style&gt;
  &lt;script="text/javascript"&gt;
  document.write("Hello World!");
  &lt;body onload="window alert('Document Loaded');"&gt;
  &lt;/script&gt;
  &lt;noscript&gt;JavaScript is not enabled!&lt;/noscript&gt;
  &lt;/head&gt;
  &lt;body id="container"&gt;
  &lt;header&gt;&lt;h1&gt;JavaScript No.1&lt;/h1&gt;&lt;/header&gt;
  
  &lt;div class="main"&gt;
  &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas interdum bibendum velit non ultrices. Aenean nulla massa, blandit sit amet erat vitae, cursus luctus nisi. Curabitur sed arcu nisi. 
  Praesent sed elit sit amet urna vestibulum bibendum. Quisque eleifend ex imperdiet lacus interdum, at ultricies ex porta. Sed ac cursus risus. Ut tempor tellus id mi faucibus, ut varius est dapibus. 
  Nunc finibus risus sem. Aliquam felis dolor, tempor eu mi eu, dictum commodo lorem. Suspendisse potenti. Vivamus porta aliquam tempus. Curabitur facilisis velit sed elit elementum congue.&lt;/p&gt;
  
  &lt;p&gt;Sed sollicitudin convallis diam, vel feugiat massa. Phasellus congue in libero ac pretium. Nunc volutpat ut lorem maximus eleifend. Mauris tincidunt rutrum dapibus. 
  Vestibulum mattis quam est, eget varius erat fermentum eu. Sed a dui ac neque molestie feugiat tempor eu urna. Praesent dictum nulla id dolor viverra viverra ac fermentum nibh. 
  Pellentesque ac commodo mauris, at scelerisque felis. Donec maximus efficitur tincidunt. Donec vehicula vel magna ut consequat. Etiam dolor nunc, malesuada non lobortis sed, pretium ac dolor. 
  Quisque semper arcu a quam faucibus, sed dictum quam egestas. Proin volutpat quis erat eget sodales. Nunc a rutrum eros.&lt;/p&gt;
  
  &lt;p&gt;Vestibulum non nisl sodales, aliquet neque eget, bibendum elit. Proin dapibus elit vitae maximus aliquet. Maecenas pellentesque, nunc in fermentum blandit, purus libero aliquet ligula, aliquam porta justo diam a tellus. 
  Aliquam quis malesuada nisl. Curabitur venenatis rhoncus felis, at faucibus mi luctus non. Ut mattis elementum risus at dignissim. Duis tempor tincidunt ligula, a rutrum erat suscipit quis. Phasellus sed eleifend odio. 
  Suspendisse feugiat neque a mattis euismod. Fusce nec vestibulum ante, sit amet hendrerit tellus. Nulla ex libero, facilisis vel tellus quis, dapibus cursus nibh. Donec sodales nisl at urna pharetra vulputate.&lt;/p&gt;
  
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>