a download Attribute - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:a

Description

The download attribute sets the name of the downloaded file.

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

Attribute Values

ValueRequire Description
filename Optional. Set the new filename for the downloaded file

The following code shows how to Download file when clicking on the link.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p>Click on the logo to download the image:<p>

<a href="https://www.java2s.com/style/demo/Opera.png" download="logo">
  <img border="0" src="https://www.java2s.com/style/demo/Opera.png" alt="alt message" width="104" height="142">
</a><!--from  w ww .  j a v  a  2  s .  co m-->

</body>
</html>

Related Tutorials