How to use the download Attribute in HTML5 ? Last Updated : 31 Jan, 2024 Improve Improve Like Article Like Save Share Report The download attribute in HTML5 is used to prompt the user to download a linked resource rather than navigate to it. When applied to an anchor <a> tag, it signifies that the linked file should be downloaded when the link is clicked. Syntax <a href="img/gfg.jpg" download>Link</a> Usage Enables direct file downloads with the `download` attribute. Provides user-friendly filenames for downloaded files. Useful for offering downloadable documents like PDFs. Facilitates the download of media files from web pages. Improves accessibility by simplifying resource downloads. Example: HTML <!DOCTYPE html> <html> <head> <title> HTML a download Attribute </title> </head> <body> <p>Click on image to download <p> <a href= "https://media.geeksforgeeks.org/wp-content/uploads/20190221234751/geeksforgeeks-logo1.png" download> <img src= "https://media.geeksforgeeks.org/wp-content/uploads/20190221234751/geeksforgeeks-logo1.png" alt="gfg" width="500" height="200"> </a> </body> </html> Output:Â Like Article Suggest improvement Next How to create a download link with HTML ? Share your thoughts in the comments Add Your Comment Please Login to comment...