0

I have tag and I have a custom url gotten by jquery , all I want to make a button click and download that custom url by jquery ?

<button>
download mp3 file
</button>

I know I can do it with Link tag but I need button tag to do it

7usien
  • 83
  • 7
  • There is alot left out here. Are you required to do it over the form, is it a static url or dynamic? Is this a school homework ;)? Do you want to use a library or write it from scratch? Do you want to use javascript or a framework like jquery or just pure html? This question has been answered many times before here and one of those answers might or might not fit your needs. https://stackoverflow.com/questions/33664398/how-to-download-file-using-javascript-only – JGoodgive Apr 27 '19 at 20:53
  • thanks a lot, I get it by making it : ~ $(location).attr('href',$href); ~ $href = my custom link download So when click on button it redirect to that link and download – 7usien Apr 29 '19 at 19:55

0 Answers0