I need to save a URL in an anchor tag on a page when a button is clicked. How can I do this with jQuery or pure JS?
If possible, can it "Save As" or otherwise name the file being saved from the URL a string that is on the page (from a specific heading tag with the id "heading", for instance)?
EDIT
To clarify:
<button id="button">Button</button>
<h1 id="heading">Website Title</h1>
<a href="http://website.com/sample.zip" id="file">File</a>
...how do I make it so that when the button is clicked it will automatically start downloading the ZIP file from the URL in the anchor tag?
Moreover, if possible, how do I have the file save with the name of the H1
tag (i.e. "Website Title.zip")?