HTML <area> download attribute

Definition and Usage

download attribute specifies the target to be downloaded when the user clicks on a hyperlink (href attribute file specified in

download The optional values of the attribute will become the new name of the file after download. Any value can be used, and the browser will automatically detect the correct file extension and add it to the file (for example, .img, .pdf, .txt, .html, etc.).

If the value is omitted, the original filename will be used.

Instance

Example 1

Use the download attribute to specify the target to be downloaded when the user clicks on a hyperlink:

<map name="planetmap">
<area shape="rect" coords="0,0,114,576" alt="Sun" href="about_sun.html" download>
<area shape="circle" coords="190,230,5" alt="Mercury" href="about_mercury.html" download>
<area shape="circle" coords="228,230,5" alt="Venus" href="about_venus.html" download>
</map>

Try It Yourself

Example 2

To specify a value for the download attribute, which will be the new filename for the downloaded file (for example, using sun.htm instead of information_about_the_sun.htm):

<map name="planetmap">
<area shape="rect" coords="0,0,114,576" alt="Sun" href="about_sun.htm" download="sun">
<area shape="circle" coords="190,230,5" alt="Mercury" href="about_mercury.html" download="mercury">
<area shape="circle" coords="228,230,5" alt="Venus" href="about_venus.html" download="venus">
</map>

Try It Yourself

Syntax

<area download="filename">

Attribute Value

Value Description
filename Optional. Specifies a new filename for the downloaded file.

Browser Support

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

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
14.0* 18.0 20.0* 10.1 15.0

* Chrome 65+ and Firefox only support same-origin download links.