I have been trying to reference my JS in my html file for a while now. I have tried many different methods that people have told me and none of them have worked. Here is what I have at the moment. <script src="script.js"></script> Yes, both files are in the same folder along with my style.css file. The reference I have for the style.css file works. I used <link rel="stylesheet" href="style.css" />
Can someone please help me fix my JS reference?
If its doesn't work check console for any problem Or check directory of script src!
someways javascript is disable on your web browser . check it and enable .
You should try:
<script src="/script.js"></script>
Some web servers might want that leading slash, while others don't need it.