Links to external JavaScript files should be in the head
section of your page, for example:
<html> <head> <title>Simple Page</title> <script src="script.js"></script> </head> <body> <p>This is a very simple HTML page</p> </body> </html>
And the file path should be relative to the location of the HTML file. So, if you have HTML and a .js file in the same folder, then the file name is correct.
Make sure both files are saved and that the .js file name is exactly what you have in the HTML file. Also, use the direct quotation marks (") that you get with a text editor, not the formatted quotes (" ") that you get with applications like Word.
source share