How do you make this open in new tab

I’m trying to make this random url post open up in a new tab, and not the existing tab you clicked. I cannot for the life on me figure out how to do that. If anyone could help me that would be super helpful.

<script type="text/javascript">
function randomlinks(){
    var myrandom=Math.round(Math.random()*3)
    var links=new Array()
    links[0]="https://www.DemiCardGame.com"
    links[1]="https://www.games.xyphienllc.com"
    links[2]="https://www.htcg.news"
    links[3]="https://www.eTableCon.com"

 
    window.location=links[myrandom]
}
</script>
<form>
<input type="button" value="random link!" onClick="randomlinks()">
</form>

Hello!

For a tag, you could add

target="_blank"

In script, you could use something like this:

Meaning, replace window.location with window.open.

To which part in the code? I’m having troubles figuring that out.

Like that:

 <script type="text/javascript">
  function randomlinks(){
      var myrandom=Math.round(Math.random()*3)
      var links=new Array()
      links[0]="https://www.DemiCardGame.com"
      links[1]="https://www.games.xyphienllc.com"
      links[2]="https://www.htcg.news"
      links[3]="https://www.eTableCon.com"

      window.open(links[myrandom], '_blank');
  }
  </script>
  <form>
  <input type="button" value="random link!" onClick="randomlinks()">
  </form>