Thanks for giving this question a look. I'm an absolute newbie in JavaScript and just tried to learn JavaScript yesterday so my knowledge about this is pretty low. (Sorry for my bad English)
I tried to run a .html file with a .js file included in it but when i ran it with Live Server Extension, I can't see the .js file in the Page tab in Sources and I can't execute the .js file too. All I see is the index.html file. Is there any solution for this, guys?
This is my page with the Inspector turned on
These are my files displayed in Visual Studio Code
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>This is the title.</title>
</head>
<body>
<h1>So this is the header</h1>
<script scr='home.js'>
alert('something')
</script>
</body>
</html>
And home.js
alert('Do you see me?');
My file structure is very simple
2nd
├── home.js
├── index.html
I've tried to
- Search a lot on Stack Overflow
- Change the directory of the .js file
- Create a sub-folder and put the .js file inside to make the .html above it(or lower the .js)
But still not working.