HTML <a> with download Attribute
HTML <a> with download Attribute
The download
attribute is used to download a URL instead of navigating to it.
Note: The download
attribute works only when the href attribute is set.
Example
Download attribute with Value
Note: The value for download
attribute is Optional.
Example
Safe Usage
Though most of the modern browser supports download
attribute, very few old browsers like Internet Explorer will not support download
attribute. So its developer's duty to notify user either to update or to switch their browser to download your file.
In the following example, we will check whether the browser supports download
attribute or not by using JavaScript.
Request: If possible, open this page in internet explorer and Run the following example.
Example
Attribute Value
Value | Explanation |
---|---|
file_name | Specifies the name of the file to be downloaded. The value for the download attribute is Optional. |
Reminder
Hi Developers, we almost covered 99.5% of HTML Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in HTML.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.