Open In App

HTML | <area> download Attribute

Last Updated : 20 Jul, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

The <area> download attribute is used to download the target content when user clicks on the hyperlink. It is used only when the href attribute is set. The name of the downloaded file will be the value of the attribute. The browser automatically detects the correct file extension and add it to the file. If the value is deleted, then the original filename is used.
Syntax: 
 

<area download="filename">

Attribute Values: It contains single value filename which is optional. It specifies the new filename for the downloaded file.
Example: 
 

html




<!DOCTYPE html>
<html>
 
<head>
    <title>
        HTML area download Attribute
    </title>
</head>
 
<body style="text-align:center;">
    <img src=
        alt="alt_attribute" width="300" height="119"
        class="aligncenter" usemap="#shapemap" />
 
    <map name="shapemap">
         
        <!-- area tag contained image. -->
        <area shape="poly" coords="59, 31, 28, 83, 91, 83" href=
        alt="Triangle" download>
         
        <area shape="circle" coords="155, 56, 26" href=
        alt="Circle" download>
         
        <area shape="rect" coords="224, 30, 276, 82" href=
        alt="Square" download="rect">
    </map>
</body>
 
</html>                   


Output: 
 

  • Before click on specific clickable area: 
     

alt_attribute

  • After click on specific clickable area: The file of this area will download. 
     

alt_attribute

Supported Browsers: The browser supported by <area> download attribute are listed below: 
 

  • Google Chrome
  • Edge 12 and above
  • Firefox
  • Opera 
  • Safari
  • Internet Explorer

 



Similar Reads

HTML | download Attribute
The HTML download Attribute is used to download the element when the user clicks on the hyperlink. It is used only when the 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.Uses: It is used in
1 min read
HTML &lt;a&gt; download Attribute
The &lt;a&gt; 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&lt;a downloa
1 min read
HTML | &lt;area&gt; target Attribute
The HTML &lt;area&gt; target Attribute is used to specify where to open the linked document. It works only when href attribute is present in the area elements. Syntax: &lt;area target="_blank|_self|_parent|_top|framename"&gt; Attribute Values: _blank: It opens the link in a new window._self: It is the default value. It opens the linked document in
1 min read
HTML | &lt;area&gt; alt Attribute
The &lt;area&gt; alt attribute is used to specify the alternative text for an image when the image attribute is not displayed. It gives alternative information for the user when the image is not loaded to display.Syntax: &lt;area alt="text"&gt; Attribute Values: It contains single value text which is used to specify the alternative text for area, i
1 min read
HTML | &lt;area&gt; href Attribute
The &lt;area&gt; href attribute is used to specify the URL of the target page. When the href attribute is not present in the &lt;area&gt; an element that it will not be a hyperlink. Syntax: &lt;area href="URL"&gt; Attribute Value: absolute URL: It points to another website.relative URL: It points to a file within a website.anchor URL: It points to
1 min read
HTML | &lt;area&gt; coords Attribute
The &lt;area&gt; coords attribute is used to specify the coordinate of an area in an image-map. It is used with shape attribute to specify the size, shape, and placement of an area. (0, 0) is the coordinate of the top-left corner.Syntax: &lt;area coords="value"&gt; Attribute Values: x1, y1, x2, y2: It specifies the coordinate of top-left (x1, y1) a
2 min read
HTML | &lt;area&gt; type Attribute
The &lt;area&gt; type attribute is used to specify the Internet media type of the linked document. It is used only when href attribute is set.Syntax: &lt;area type="media_type"&gt; Note: This attribute is not supported in HTML5. Attribute Values: It contains single value media_type which is used to specify the Internet media type of the embedded fi
1 min read
HTML | &lt;area&gt; rel Attribute
The &lt;area&gt; rel attribute is used to specify the relationship between the current and the linked document. It is used only when href attribute present. Syntax: &lt;area rel="value"&gt; Attribute Values: alternate: It defines an alternate version of the document i.e. print page, translated or mirror.author: It defines the author of the document
2 min read
HTML | &lt;area&gt; shape Attribute
The HTML area shape Attribute is used with the coords attribute to describe the size, shape, and placement of a &lt;area&gt; element. Syntax: &lt;area shape="default | rect | circle | poly"&gt; Attribute Values: default: It is used to specify the entire region.rect: It is used to specify the rectangular region.circle: It is used to specify a circul
1 min read
HTML | &lt;area&gt; media Attribute
The HTML area media attribute is used to specify the media or device the target URL is optimized for. this attribute specify the style is for specific devices like print media or speech. This attribute can accept several values. Only used if the href attribute is present. This attribute is purely advisory.Syntax: &lt;area media="value"&gt; Possible
2 min read