HTMLAnchorElement.download

您正在阅读此内容的英文版本,因为该语系尚未翻译。 帮助我们翻译此文章吧!

HTMLAnchorElement.download属性是一个DOMString ,表明链接的资源将被下载,而不是显示在浏览器中。该值表示文件的建议名称。如果该名称不是基础操作系统的有效文件名,浏览器将对其进行调整。

语法

var dnload = anchorElt.download;
anchorElt.download = dnload;

规范Edit

Specification Status Comment
HTML Living Standard
download
Living Standard No change from Document Object Model (DOM) Level 2 HTML Specification

浏览器的兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
downloadChrome Full support 14Edge Full support 13Firefox Full support 20IE ? Opera Full support 15Safari Full support YesWebView Android Full support YesChrome Android Full support 18Firefox Android Full support YesOpera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown