Home > Software engineering >  How to click button Function and go another page at same time
How to click button Function and go another page at same time

Time:02-10

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:

  •  Tags:  
  • Related