title: how to display alert box in using html+javascript and node
body: <p>I am running node project with html and javascript. How can I display the alert box in html. </p>
  
  <p>My html (index.html)</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
              &lt;script src="./watch.js"&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body onload="showBox()"&gt;
          &lt;h1&gt;Heading&lt;/h1&gt;
          &lt;p&gt;Paragraph&lt;/p&gt;        
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>watch.js</p>
  
  <pre><code>function showBox(){
      alert("this is alert box");    
  }
  </code></pre>
  
  <p>server.js</p>
  
  <pre><code>var http = require('http');
  var fs = require('fs');
  
  const PORT=8080; 
  
  fs.readFile('./index.html', function (err, html) {
  
      if (err) throw err;    
  
      http.createServer(function(request, response) {  
          response.writeHeader(200, {"Content-Type": "text/html"});  
          response.write(html);  
          response.end();  
      }).listen(PORT);
  });
  </code></pre>
  
  <p>Error
  <a href="https://i.stack.imgur.com/A4u6n.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A4u6n.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/lVze2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lVze2.png" alt="enter image description here"></a></p>