``` --- ## Browser Support The numbers"> ``` --- ## Browser Support The numbers" />
Easy Tutorial
❮ Tag Rt Att Div Align ❯

HTML <a> download Attribute

HTML <a> Tag

Example

Click the link to download the image:

<a href="/images/logo.png" download="/images/logo.png">

Browser Support

The numbers in the table specify the first browser version that fully supports the attribute.

Element
download 14.0 13.0 20.0 10.1 15.0

Definition and Usage

The download attribute specifies the URL of the file to be downloaded.

The href attribute must be specified within the <a> tag.

The attribute can also specify the name of the downloaded file. The file name is not restricted, and browsers will automatically append the appropriate file extension (.img, .pdf, .txt, .html, etc.) to the file name.

This attribute requires that the resource to be downloaded is from the same origin.

For more comprehensive functionality, you can use a JavaScript third-party library: download.js.


Differences Between HTML 4.01 and HTML5

The download attribute is a new attribute added to the <a> tag in HTML5.


Syntax

Attribute Values

Value Description
filename Specifies the name of the file.

HTML <a> Tag

❮ Tag Rt Att Div Align ❯