HTML | <a> download Attribute
The download attribute is used to download the element when the user clicks on the hyperlink. It is used only when href attribute is set. The downloaded file name will be the value of the attribute. The value of the attribute will be the name of the downloaded file. It the value is removed then original filename used.
Syntax:
<a download="filename">
Attribute Values: It contains single value filename which is optional. It specifies the new filename for the downloaded file.
Example:
<!DOCTYPE html> <html> <head> <title> HTML a download Attribute </title> </head> <body> <p>Click on image to download <p> <a href= download> <img src= alt="gfg" width="500" height="200"> </a> </body> </html> |
Output:

Supported Browsers: The browser supported by HTML <a> download Attribute are listed below:
- Google Chrome 14.0
- Internet Explorer 13.0
- Firefox 20.0
- Safari 10.1
- Opera 15.0
Recommended Posts:
- HTML | download Attribute
- HTML | <area> download Attribute
- HTML | DOM Anchor download Property
- How to trigger a file download when clicking an HTML button or JavaScript?
- HTML | low Attribute
- HTML | dir Attribute
- HTML | alt attribute
- HTML | <img> alt Attribute
- HTML | name Attribute
- HTML | max attribute
- HTML | min Attribute
- HTML | value Attribute
- HTML | <map> name Attribute
- HTML | <img> src Attribute
- HTML | <li> value Attribute
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



