HTML download Attribute



w3schools.com
THE WORLD'S LARGEST WEB DEVELOPER SITE



THE WORLD'S LARGEST WEB DEVELOPER SITE















HTML
CSS
JAVASCRIPT
SQL
PHP
BOOTSTRAP
HOW TO
JQUERY
W3.CSS
PYTHON
XML
MORE


FORUM
EXAMPLES
REFERENCES











HTML
CSS
JAVASCRIPT
SQL
PHP
BOOTSTRAP
HOW TO
JQUERY
W3.CSS
PYTHON
XML
MORE


FORUM
EXAMPLES
REFERENCES









HTML
CSS
JAVASCRIPT
SQL
PHP
BOOTSTRAP
HOW TO
JQUERY
W3.CSS
PYTHON
XML
MORE


FORUM
EXAMPLES
REFERENCES






HTML and CSS


Learn HTML
Learn CSS
Learn W3.CSS
Learn Colors
Learn Bootstrap 3
Learn Bootstrap 4
Learn Graphics
Learn Icons
Learn How To


JavaScript


Learn JavaScript
Learn jQuery
Learn AngularJS
Learn JSON
Learn AJAX
Learn W3.JS






Server Side


Learn SQL
Learn PHP
Learn Python
Learn ASP
Learn Node.js
Learn Raspberry Pi

Web Building


Web Templates
Web Statistics
Web Certificates
Web Editor


XML


Learn XML
Learn XML AJAX
Learn XML DOM
Learn XML DTD
Learn XML Schema
Learn XSLT
Learn XPath
Learn XQuery




HTML and CSS


Learn HTML
Learn CSS
Learn W3.CSS
Learn Colors
Learn Bootstrap 3
Learn Bootstrap 4
Learn Graphics
Learn Icons
Learn How To



JavaScript


Learn JavaScript
Learn jQuery
Learn AngularJS
Learn JSON
Learn AJAX
Learn W3.JS












Server Side


Learn SQL
Learn PHP
Learn Python
Learn ASP
Learn Node.js
Learn Raspberry Pi

Web Building


Web Templates
Web Statistics
Web Certificates
Web Editor



XML


Learn XML
Learn XML AJAX
Learn XML DOM
Learn XML DTD
Learn XML Schema
Learn XSLT
Learn XPath
Learn XQuery






HTML


HTML Tag Reference
HTML Event Reference
HTML Color Reference
HTML Attribute Reference
HTML Canvas Reference
HTML SVG Reference
Google Maps Reference

Charsets


HTML Character Sets
HTML ASCII
HTML ANSI
HTML Windows-1252
HTML ISO-8859-1
HTML Symbols
HTML UTF-8


CSS


CSS Reference
CSS Browser Support
CSS Selector Reference
W3.CSS Reference
Bootstrap Reference
Icon Reference

XML


XML Reference
XML Http Reference
XSLT Reference
XML Schema Reference


JavaScript


JavaScript Reference
HTML DOM Reference
jQuery Reference
AngularJS Reference
W3.JS Reference

Server Side


PHP Reference
SQL Reference
Python Reference
ASP Reference




HTML


HTML Tag Reference
HTML Event Reference
HTML Color Reference
HTML Attribute Reference
HTML Canvas Reference
HTML SVG Reference
Google Maps Reference

Charsets


HTML Character Sets
HTML ASCII
HTML ANSI
HTML Windows-1252
HTML ISO-8859-1
HTML Symbols
HTML UTF-8



CSS


CSS Reference
CSS Browser Support
CSS Selector Reference
W3.CSS Reference
Bootstrap Reference
Icon Reference

XML


XML Reference
XML Http Reference
XSLT Reference
XML Schema Reference



JavaScript


JavaScript Reference
HTML DOM Reference
jQuery Reference
AngularJS Reference
W3.JS Reference

Server Side


PHP Reference
SQL Reference
Python Reference
ASP Reference






HTML/CSS


HTML Examples
CSS Examples
W3.CSS Examples
W3.CSS Templates
Bootstrap Examples
How To Examples
SVG Examples


JavaScript


JavaScript Examples
HTML DOM Examples
jQuery Examples
AngularJS Examples
AJAX Examples
W3.JS Examples


Server Side


PHP Examples
ASP Examples

XML


XML Examples
XSLT Examples
XPath Examples
XML Schema Examples
SVG Examples


Quizzes


HTML Quiz
CSS Quiz
JavaScript Quiz
Bootstrap Quiz
jQuery Quiz
PHP Quiz
SQL Quiz
XML Quiz




HTML/CSS


HTML Examples
CSS Examples
W3.CSS Examples
W3.CSS Templates
Bootstrap Examples
How To Examples
SVG Examples



JavaScript


JavaScript Examples
HTML DOM Examples
jQuery Examples
AngularJS Examples
AJAX Examples
W3.JS Examples



Server Side


PHP Examples
ASP Examples

XML


XML Examples
XSLT Examples
XPath Examples
XML Schema Examples
SVG Examples



Quizzes


HTML Quiz
CSS Quiz
JavaScript Quiz
Bootstrap Quiz
jQuery Quiz
PHP Quiz
SQL Quiz
XML Quiz





×


HTML Reference


HTML by Alphabet
HTML by Category
HTML Attributes
HTML Global Attributes
HTML Events
HTML Colors
HTML Canvas
HTML Audio/Video
HTML Character Sets
HTML Doctypes
HTML URL Encode
HTML Language Codes
HTML Country Codes
HTTP Messages
HTTP Methods
PX to EM Converter
Keyboard Shortcuts



HTML Tags


<!-->
<!DOCTYPE>
<a>
<abbr>
<acronym>
<address>
<applet>
<area>
<article>
<aside>
<audio>
<b>
<base>
<basefont>
<bdi>
<bdo>
<big>
<blockquote>
<body>
<br>
<button>
<canvas>
<caption>
<center>
<cite>
<code>
<col>
<colgroup>
<data>
<datalist>
<dd>
<del>
<details>
<dfn>
<dialog>
<dir>
<div>
<dl>
<dt>
<em>
<embed>
<fieldset>
<figcaption>
<figure>
<font>
<footer>
<form>
<frame>
<frameset>
<h1> - <h6>
<head>
<header>
<hr>
<html>
<i>
<iframe>
<img>
<input>
<ins>
<kbd>
<label>
<legend>
<li>
<link>
<main>
<map>
<mark>
<meta>
<meter>
<nav>
<noframes>
<noscript>
<object>
<ol>
<optgroup>
<option>
<output>
<p>
<param>
<picture>
<pre>
<progress>
<q>
<rp>
<rt>
<ruby>
<s>
<samp>
<script>
<section>
<select>
<small>
<source>
<span>
<strike>
<strong>
<style>
<sub>
<summary>
<sup>
<svg>
<table>
<tbody>
<td>
<template>
<textarea>
<tfoot>
<th>
<thead>
<time>
<title>
<tr>
<track>
<tt>
<u>
<ul>
<var>
<video>
<wbr>









×


HTML Reference


HTML by Alphabet
HTML by Category
HTML Attributes
HTML Global Attributes
HTML Events
HTML Colors
HTML Canvas
HTML Audio/Video
HTML Character Sets
HTML Doctypes
HTML URL Encode
HTML Language Codes
HTML Country Codes
HTTP Messages
HTTP Methods
PX to EM Converter
Keyboard Shortcuts



HTML Tags


<!-->
<!DOCTYPE>
<a>
<abbr>
<acronym>
<address>
<applet>
<area>
<article>
<aside>
<audio>
<b>
<base>
<basefont>
<bdi>
<bdo>
<big>
<blockquote>
<body>
<br>
<button>
<canvas>
<caption>
<center>
<cite>
<code>
<col>
<colgroup>
<data>
<datalist>
<dd>
<del>
<details>
<dfn>
<dialog>
<dir>
<div>
<dl>
<dt>
<em>
<embed>
<fieldset>
<figcaption>
<figure>
<font>
<footer>
<form>
<frame>
<frameset>
<h1> - <h6>
<head>
<header>
<hr>
<html>
<i>
<iframe>
<img>
<input>
<ins>
<kbd>
<label>
<legend>
<li>
<link>
<main>
<map>
<mark>
<meta>
<meter>
<nav>
<noframes>
<noscript>
<object>
<ol>
<optgroup>
<option>
<output>
<p>
<param>
<picture>
<pre>
<progress>
<q>
<rp>
<rt>
<ruby>
<s>
<samp>
<script>
<section>
<select>
<small>
<source>
<span>
<strike>
<strong>
<style>
<sub>
<summary>
<sup>
<svg>
<table>
<tbody>
<td>
<template>
<textarea>
<tfoot>
<th>
<thead>
<time>
<title>
<tr>
<track>
<tt>
<u>
<ul>
<var>
<video>
<wbr>







×


HTML Reference


HTML by Alphabet
HTML by Category
HTML Attributes
HTML Global Attributes
HTML Events
HTML Colors
HTML Canvas
HTML Audio/Video
HTML Character Sets
HTML Doctypes
HTML URL Encode
HTML Language Codes
HTML Country Codes
HTTP Messages
HTTP Methods
PX to EM Converter
Keyboard Shortcuts



HTML Tags


<!-->
<!DOCTYPE>
<a>
<abbr>
<acronym>
<address>
<applet>
<area>
<article>
<aside>
<audio>
<b>
<base>
<basefont>
<bdi>
<bdo>
<big>
<blockquote>
<body>
<br>
<button>
<canvas>
<caption>
<center>
<cite>
<code>
<col>
<colgroup>
<data>
<datalist>
<dd>
<del>
<details>
<dfn>
<dialog>
<dir>
<div>
<dl>
<dt>
<em>
<embed>
<fieldset>
<figcaption>
<figure>
<font>
<footer>
<form>
<frame>
<frameset>
<h1> - <h6>
<head>
<header>
<hr>
<html>
<i>
<iframe>
<img>
<input>
<ins>
<kbd>
<label>
<legend>
<li>
<link>
<main>
<map>
<mark>
<meta>
<meter>
<nav>
<noframes>
<noscript>
<object>
<ol>
<optgroup>
<option>
<output>
<p>
<param>
<picture>
<pre>
<progress>
<q>
<rp>
<rt>
<ruby>
<s>
<samp>
<script>
<section>
<select>
<small>
<source>
<span>
<strike>
<strong>
<style>
<sub>
<summary>
<sup>
<svg>
<table>
<tbody>
<td>
<template>
<textarea>
<tfoot>
<th>
<thead>
<time>
<title>
<tr>
<track>
<tt>
<u>
<ul>
<var>
<video>
<wbr>







HTML Tags


<!-->
<!DOCTYPE>
<a>
<abbr>
<acronym>
<address>
<applet>
<area>
<article>
<aside>
<audio>
<b>
<base>
<basefont>
<bdi>
<bdo>
<big>
<blockquote>
<body>
<br>
<button>
<canvas>
<caption>
<center>
<cite>
<code>
<col>
<colgroup>
<data>
<datalist>
<dd>
<del>
<details>
<dfn>
<dialog>
<dir>
<div>
<dl>
<dt>
<em>
<embed>
<fieldset>
<figcaption>
<figure>
<font>
<footer>
<form>
<frame>
<frameset>
<h1> - <h6>
<head>
<header>
<hr>
<html>
<i>
<iframe>
<img>
<input>
<ins>
<kbd>
<label>
<legend>
<li>
<link>
<main>
<map>
<mark>
<meta>
<meter>
<nav>
<noframes>
<noscript>
<object>
<ol>
<optgroup>
<option>
<output>
<p>
<param>
<picture>
<pre>
<progress>
<q>
<rp>
<rt>
<ruby>
<s>
<samp>
<script>
<section>
<select>
<small>
<source>
<span>
<strike>
<strong>
<style>
<sub>
<summary>
<sup>
<svg>
<table>
<tbody>
<td>
<template>
<textarea>
<tfoot>
<th>
<thead>
<time>
<title>
<tr>
<track>
<tt>
<u>
<ul>
<var>
<video>
<wbr>









googletag.cmd.push(function() { googletag.display('div-gpt-ad-1422003450156-2'); });



HTML <a> download Attribute


❮ HTML <a> tag




Example


Download file when clicking on the link (instead of navigating to the file):



<a href="/images/myw3schoolsimage.jpg" download>

Try it Yourself »

More "Try it Yourself" examples below.




Definition and Usage


The download attribute specifies that the target will be downloaded when a user clicks on the hyperlink.


This attribute is only used if the href attribute is set.


The value of the attribute will be the name of the downloaded file. There are
no restrictions on allowed values, and the browser will automatically detect the
correct file extension and add it to the file (.img, .pdf, .txt, .html, etc.).


If the value is omitted, the original filename is used.




Browser Support


The numbers in the table specify the first browser version that fully supports the attribute.



















Attribute
download 14.0 13.0 20.0 10.1 15.0



Differences Between HTML 4.01 and HTML5


The download attribute is new for the <a> tag in HTML5.




Syntax



<a download="filename">

Attribute Values











Value Description
filename Optional. Specifies the new filename for the downloaded file



More Examples



Example


Specify a value for the download attribute, which will be the new filename of the
downloaded file ("w3logo.jpg" instead of "myw3schoolsimage.jpg"):



<a href="/images/myw3schoolsimage.jpg" download="w3logo">

Try it Yourself »



❮ HTML <a> tag










googletag.cmd.push(function() { googletag.display('div-gpt-ad-1422003450156-2'); });



HTML <a> download Attribute


❮ HTML <a> tag




Example


Download file when clicking on the link (instead of navigating to the file):



<a href="/images/myw3schoolsimage.jpg" download>

Try it Yourself »

More "Try it Yourself" examples below.




Definition and Usage


The download attribute specifies that the target will be downloaded when a user clicks on the hyperlink.


This attribute is only used if the href attribute is set.


The value of the attribute will be the name of the downloaded file. There are
no restrictions on allowed values, and the browser will automatically detect the
correct file extension and add it to the file (.img, .pdf, .txt, .html, etc.).


If the value is omitted, the original filename is used.




Browser Support


The numbers in the table specify the first browser version that fully supports the attribute.



















Attribute
download 14.0 13.0 20.0 10.1 15.0



Differences Between HTML 4.01 and HTML5


The download attribute is new for the <a> tag in HTML5.




Syntax



<a download="filename">

Attribute Values











Value Description
filename Optional. Specifies the new filename for the downloaded file



More Examples



Example


Specify a value for the download attribute, which will be the new filename of the
downloaded file ("w3logo.jpg" instead of "myw3schoolsimage.jpg"):



<a href="/images/myw3schoolsimage.jpg" download="w3logo">

Try it Yourself »



❮ HTML <a> tag








googletag.cmd.push(function() { googletag.display('div-gpt-ad-1422003450156-2'); });



HTML <a> download Attribute


❮ HTML <a> tag




Example


Download file when clicking on the link (instead of navigating to the file):



<a href="/images/myw3schoolsimage.jpg" download>

Try it Yourself »

More "Try it Yourself" examples below.




Definition and Usage


The download attribute specifies that the target will be downloaded when a user clicks on the hyperlink.


This attribute is only used if the href attribute is set.


The value of the attribute will be the name of the downloaded file. There are
no restrictions on allowed values, and the browser will automatically detect the
correct file extension and add it to the file (.img, .pdf, .txt, .html, etc.).


If the value is omitted, the original filename is used.




Browser Support


The numbers in the table specify the first browser version that fully supports the attribute.



















Attribute
download 14.0 13.0 20.0 10.1 15.0



Differences Between HTML 4.01 and HTML5


The download attribute is new for the <a> tag in HTML5.




Syntax



<a download="filename">

Attribute Values











Value Description
filename Optional. Specifies the new filename for the downloaded file



More Examples



Example


Specify a value for the download attribute, which will be the new filename of the
downloaded file ("w3logo.jpg" instead of "myw3schoolsimage.jpg"):



<a href="/images/myw3schoolsimage.jpg" download="w3logo">

Try it Yourself »



❮ HTML <a> tag






googletag.cmd.push(function() { googletag.display('div-gpt-ad-1422003450156-2'); });





googletag.cmd.push(function() { googletag.display('div-gpt-ad-1422003450156-2'); });



Example


Download file when clicking on the link (instead of navigating to the file):



<a href="/images/myw3schoolsimage.jpg" download>

Try it Yourself »



<a href="/images/myw3schoolsimage.jpg" download>



<a download="filename">



<a download="filename">



Example


Specify a value for the download attribute, which will be the new filename of the
downloaded file ("w3logo.jpg" instead of "myw3schoolsimage.jpg"):



<a href="/images/myw3schoolsimage.jpg" download="w3logo">

Try it Yourself »



<a href="/images/myw3schoolsimage.jpg" download="w3logo">


Popular posts from this blog

How to make file upload 'Required' in Contact Form 7?

Rothschild family

amazon EC2 - How to make wp-config.php to writable?