• Follow me on:

Monday, February 1, 2021

Trigger a file download when clicking an HTML button

We can use HTML5 download attribute to simply download a file on a button click.
This download attribute is used in an anchor tag to prepare the location of the file that has to be a downloaded.  The name of the file needs to be the value of the attribute.

<a download="filename">
filename: attribute specifies the name for the file that will be downloaded.

Share your solutions!   


No comments:

Post a Comment

All Rights Reserved Jaydharphics Click To Mail Me (+91 9564 5592 84)