Question:
Ok so i’m trying to connect the ‘script.js’ file to the HTML (External JS) but from some reason it’s not working, however, when I use the <script></script>
tags in the HTML file it works without chnaging the code
Repl link:
https://replit.com/@JohnnySuriano/Cycle-Clicker#index.html
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="script.js"></script>
<title>Cycle Clicker</title>
</head>
<body>
<p>Score: <span id='score'>0</span></p>
<img src="images/cycle.png" height="256px" width="256px">
</body>
</html>
JS
let score = 0;
score = score + 1;
document.getElementById('score').innerHTML = score;
alert(score)
Files
Knowing me it would probably be some stupid spelling mistake or something but thanks for any help