I'm dealing with serious issue here. My JavaScript file doesn't seem to be linking to my HTML file. I have them all in the same location, so that's not the problem. My script link is also fine in HTML. It just doesn't seem to link strange enough. The JavaScript statements seem to work when I use script tags in my HTML-file, but the same statements just won't load when I use them in a separate JavaScript file.
This seems to be fine:
<script type="text/javascript" src="script.js"></script>
I'm using Brackets by the way.
I tried using the full path to the JS-file and that didn't work either. I don't have any webservers. It's an assignment for school where I need to construct a form for patients. I designed it with CSS and now I'm trying to bring some logic into it using JS, but my JS-file doesn't want to link it. Maybe it did link, but it doesn't want to work somehow. This is the code Im trying to run in the JS-file:
var elem = document.getElementById("patientnummer"); elem.value = "12345678";
No errors at all. It works fine when I use this exact code in script-tags in my HTML-file, but it doesnt work when I use it in a JS-file.