You can turn a link into a download link using the download attribute. This will allow users to download files instead of visiting pages in your web browser. You can use them to let users download images, PDF files, HTML files, or other types of files.
Steps
Add anchor element
First, type a and press Tab. Type index.html for the href value and Download HTML template for the text in between the tags.
Check preview
If you check the preview, you should see a link that says “Download HTML template”. Right now, this is just a normal link to the homepage. To turn it into a download link, add the download attribute after the href value.
If you click on the link in the preview, you will be prompted to download the file. The filename will default to index.html, since that’s the name of the original file. If you want to customize the filename, you can give the download attribute a value. Add an equals sign, a pair of quotes, and the name template.html in between the quotes.
Now if you click on the link in the preview, you’ll be prompted to download the file again, but the filename will say template.html instead of index.html.