HTML <a> download Attribute (original) (raw)

Last Updated : 23 May, 2024

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. If the value is removed then original filename used.

**Syntax

**Attribute Values

**Example: This example demonstrates the use of HTML download attribute.

html `

HTML a download Attribute

GeeksforGeeks

<h2>HTML a download Attribute</h2>

<p><a href="button.png" download>
        Click Here to Download Image
</a></p>

`

**Output

HTML-a-download-Attribute

**Supported Browsers