I have an HTML element that downloads a file when clicked.
<a href="my-file.txt" download>
Download File
</a>
But, the download
attribute isn't supported in most browsers. If it isn't supported, I want to run a function when clicked. Is this possible with jQuery/JavaScript?