I’m trying to make clicking on the link make it download. It only refreshes the page right now.
<h1 id="MainText"></h1>
<h2 id="MainText2" ></h2>
<body>
<a download="WhySweden" href="C:\Users\capta\Downloads\The_Rake_Files\New folder\WhySweden.html"> download the files here</a>
</body>
<p id ="ColouredText" style="color:red; font-family: sans-serif;">
<a download="WhySweden" href="C:\Users\capta\Downloads\The_Rake_Files\New folder\WhySweden.html"> download the files here</a>
<script>
const theHeader = document.getElementById("MainText")
const ColouredText = document.getElementById("ColouredText")
const RandomNum = Math.random()
console.log(RandomNum)
theHeader.textContent = "Random number of the day: " + RandomNum
ColouredText.textContent = "wow"
</script>