A few of my HTML5 pages have hyperlinks to files (plain text, but with a custom file type). If the user clicks these links in their browser, I need to force these links to download rather than opening directly in the browser.
HTML5 supports the "download" attribute, as in the following example:
Code: Select all
<a href="path/to/file" download>Click here to download</a>
Code: Select all
'>' is an unexpected token. The expected token is '='.
So, has anyone else successfully implemented the download attribute?