So I started to learn HTML and JavaScript not long ago and I wonder how I could access an URL/download a file from a function I made with JavaScript in another file and imported it with
<script src="jscriptSheet.js"></script>
Maybe I am wording the search badly but I didn't found anything that helps me. The only thing I saw, was doing a form and sending it to a server, but that's not what I need (I think).
What I'm doing is creating 2 dates that need to be passed to the URL so it can access the file and download it:
<div class="dateWrapper">
<p id="date1">Date1:</p>
<input id="date1INPUT" type="date">
<p id="date2">Date2:</p>
<input id="date2INPUT" type="date">
<br><br>
<button id="datesubmit" type="submit" onclick="downloadF()">Download file.</button>
</div>
And the function made with JavaScript:
function downloadF{
href="100.100.100.100/something/something.php?date1="+ date1 from the input above +"&date2="+ date2 from the input above +"&something=10.php"
}
When I execute this, it downloads nothing, it's just a normal button with no action.
How can I do it?