How to download file when clicking on the link?

In HTML5 <a> tag has a new "download" attribute.

<a href="" download>
In the above example the image will be downloaded when a user clicks on the hyperlink.

The 'download' attribute will work with .pdf, .txt, .html, etc. file extensions.

Final code and demo is here


No comments:

Post a Comment