HTML download attribute

download attribute makes the linked file to download in the local file system for the user.

Example


<a href="files/demo.html" download="list of items"> download file </a>
Try </>

The name of the downloaded file will be the value of download attribute i.e. a list of items in the local systems.

download attribute value

The value is plain text. The value of download attribute gives default name to the downloaded file in the local file systems.

In the above example, the value of download attribute is the name of the downloaded file.

But if you omit the value of download attribute then the file will be downloaded with the original name.

An author should be cautioned in labeling the downloaded file name and should take into consideration the punctuation rules in file names.

Related Tags

The tags that support this attribute are as follows.

<a> tag

This element represents the hyperlink of the the linked file.

<a href="address of linked document" download="name of the downloaded file"> file </a>

<area> tag

This element represents the area to be downloaded.

Example

<area alt="circle" title="circle" href="circ.html" shape="circle" coords="196,89,33" download="circle">

Try</>


Was this article helpful?

 

Email:

Message:

Get the newsletter