I need to BLEND this function with a function to RANDOMIZE my list before OPEN all my links, all done from a single click.
This question is not about to Randomize, nor how to Open several links. It is about to BLEND both functions to be performed from one single click.
I need a javascript able to open all my links, each of them on its own tab, in different random order each time, from one single click.
I know how to randomize elements, and how to open several links each of them on its own tab. However I can't figure out how BLEND them together to randomize several links before opening all of them on its own tab from one single click.
I have searched a lot and found a few similar posts but none of them got its question solved, as their replies teach how to randomize all links to open only one of the links which is NOT what I'm asking here.
Again, I'm looking for one javascript able to open all my links, each of them on its own tab, in different random order each time, from one single click.
This is my current code to open several links all of them on its on tab, but of course, without finding a way to blend a randomizing function with it, all of my links still open in the same order, obviously:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div><span class="randomLinks">Random Links</span></div>
<script>
$('.randomLinks').click(function(randomLinks) {
randomLinks.preventDefault();
window.open('https://link-01.moc');
window.open('https://link-02.moc');
window.open('https://link-03.moc');
window.open('https://link-04.moc');
window.open('https://link-05.moc');
window.open('https://link-06.moc');
window.open('https://link-07.moc');
window.open('https://link-08.moc');
window.open('https://link-09.moc');
window.open('https://link-10.moc');
});
</script>
I'm open to use any suggestion to solve this, as I know there are dozens of algorithms and functions to shuffle elements, but I can't find any way to blend them with this code.
I don't mind to change completely my code, as long as it opens all my links each of them on a different tab, in a different random order each time.