How do you import a local js file into a basic html file?

I have a very basic html file that uses a script tag to import a javascript file, but the javascript file is not run when I load the html locally in a browser. How am I formatting the script tag incorrectly?

Folder Structure

-folder
  --test.html
  --script.js

test.html

<html lang="en">
<head>
  <meta charset="utf-8">
  <title>TEST</title>
</head>

<body>
  <p>TEST</p>
  <script type='text/javascript' src="script.js" />
</body>
</html>

script.js

console.log('HELLO WORLD')

(function () {
  setTimeout(() => alert('HELLO WORLD'), 3000)
})();

156 thoughts on “How do you import a local js file into a basic html file?”

  1. Pingback: buy sildenafil
  2. Pingback: viagra online usa
  3. Pingback: viagra samples
  4. Pingback: viagra
  5. Pingback: cheapest cialis uk
  6. Pingback: cialis soft
  7. Pingback: viagra connect
  8. Pingback: viagra generic
  9. Pingback: otc viagra
  10. Pingback: sildenafil generic
  11. Pingback: cheap cialis
  12. Pingback: walmart cialis
  13. Pingback: viagra cialis
  14. Pingback: buy viagra cheap
  15. Pingback: online viagra
  16. Pingback: viagra tablet
  17. Pingback: viagra pornhub
  18. Pingback: hims viagra
  19. Pingback: viagra cock
  20. Pingback: viagra for men
  21. Pingback: goodrx sildenafil
  22. Pingback: cialis or viagra

Leave a Comment