Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <h1>The Anchor Object</h1> <h2>The download Attribute</h2> <a id="myAnchor" href="w3schools.jpg" download="w3logo"> <img src="w3schools.jpg" alt="W3Schools" width="104" height="142"></a> <p>The value of the download attribute is:</p> <p id="demo"></p> <script> document.getElementById("myAnchor").download = "newValue"; document.getElementById("demo").innerHTML = document.getElementById("myAnchor").download; </script> </body> </html>