I have an array which selects one of two links. When the button is pressed it opens one of the URLs that are in the array, I'd like it to open in a new tab but currently, it isn't. I had added the code below. Any help would be much appreciated.
Javascript:
function randomlinks(){ var myrandom=Math.round(Math.random()*1) var links=new Array() links[0]="http://link1.com" links[1]="http://link2.com" window.location=links[myrandom] }
HTML:
input onclick="randomlinks()" type="button" value="Click Here!"