downloadBaseline · Widely available
The download attribute for <a> elements loads the target URL as a file to be saved, instead of navigating to it. An optional attribute value sets a default file name.
Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Sep 19, 2019. Widely available since Mar 19, 2022.
Browser support
DesktopChrome
1–13Not supported
14+Supportedsince Sep 16, 2011
Current: 155Edge
12–17Not supported
18+Supportedsince Oct 2, 2018
Current: 154Firefox
1–19Not supported
20+Supportedsince Apr 2, 2013
Current: 157Safari
1–10Not supported
10.1+Supportedsince Mar 27, 2017
Current: 27MobileChrome Android
18+Supportedsince Jun 27, 2012
Current: 155Firefox Android
4–19Not supported
20+Supportedsince Apr 2, 2013
Current: 157Safari iOS
1–12.2Not supported
13+Supportedsince Sep 19, 2019
Current: 27How to use
This feature is Baseline widely available — use it freely, no fallback needed.
Example
Full syntax and examples are on MDN: download.
Feature detection
JS · check before using
if ("HTMLAnchorElement" in globalThis && "download" in HTMLAnchorElement.prototype) {
// HTMLAnchorElement.download is available
}Documentation (MDN)
Specification
Usage share
Sub-features
Support for each part of the feature (6). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| HTMLAnchorElement.download | 15 | 13 | 20 | 10.1 | 18 | 20 | 10.3 |
| HTMLAreaElement.download | 54 | 13 | 20 | 10.1 | 54 | 20 | 10.3 |
| SVGAElement.download | 142 | 142 | 20 | ✕ | 142 | 20 | ✕ |
| a.download | 14 | 18 | 20 | 10.1 | 18 | 20 | 13 |
| area.download | 54 | 12 | 20 | 10.1 | 54 | 20 | 10.3 |
| a.download | 142 | 142 | 20 | ✕ | 142 | 20 | ✕ |