HTML <a> download property
Examples
Click the link to download the image:
<a href="../images/logo.png" download="w3clogo">
try it"
Browser Support
Figures in the table represent the first browser to support the property version number.
element | |||||
---|---|---|---|---|---|
download | 14.0 | 13.0 | 20.0 | not support | 15.0 |
Definition and Usage
download attribute defines the download link address.
href attribute must be specified in <a> tag.
The same property can specify the name of the downloaded file. File names do not limit, the browser will automatically add the suffix at the end of the file name of the downloaded file (.img, .pdf, .txt, .html, etc.).
The difference between HTML 4.01 and HTML5
download attribute is new in HTML5 <a> tag attributes.
grammar
<a
download="filename">
Property Value
value | description |
---|---|
filename | Specify the file name. |