I want click download button and go another page at same time I'm try it many times but didn't work
<a onclick="yourlink()" download="" button ><i ></i> Download </button></a>
<a id="newtest" hidden="hidden" onclick="saveDownloadDetails();" href="{{asset($Music->Audio->filename) }}" download="" data-uk-tooltip="title: {{ __('main.Download_Track')}}"></i></button></a>
<script>
function yourlink(){
var locs = [href= "{{ url('/download') }}"]
for (let i = 0; i < locs.length; i ) {
window.open(locs[i], "_self")
document.getElementById("newtest").click();
}
};
</script>
CodePudding user response:
