HTMLAnchorElement.download
The HTMLAnchorElement.download
property is a DOMString
indicating that the linked resource is intended to be downloaded rather than displayed in the browser. The value, if any, specifies the default file name for use in labeling the resource in a local file system. If the name is not a valid file name in the underlying OS, the browser will adjust it.
Note: This value might not be used for download. This value cannot be used to determine whether the download will occur.
Syntax
var dnload = anchorElt.download; anchorElt.download = dnload;
Specifications
Specification |
---|
HTML Standard (HTML) # dom-a-download |
Browser compatibility
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
download |
15 |
13 |
20 |
No |
15 |
10.1 |
≤37 |
18 |
20 |
14 |
10.3 |
1.0 |
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/download