Also ich eine nutzlose Website erstellen und ich muss eine Schaltfläche, die Menschen auf zufällige Websites in neue Registerkarten leitet. Ich habe bereits den Random-Link-Button-Code, aber ich kann nicht scheinen, es mit dem neuen Tab-Code hinzuzufügen.Wie mache ich eine HTML-Schaltfläche in zufälligen Links in der neuen Registerkarte öffnen
Probe
var randomlinks=new Array(10)
randomlinks[0]="http://ducksarethebest.com/"
randomlinks[1]="http://cant-not-tweet-this.com/"
randomlinks[2]="http://just-shower-thoughts.tumblr.com/"
randomlinks[3]="http://www.fallingfalling.com/"
randomlinks[4]="http://www.partridgegetslucky.com/"
randomlinks[5]="http://ducksarethebest.com/"
randomlinks[6]="http://cant-not-tweet-this.com/"
randomlinks[7]="http://just-shower-thoughts.tumblr.com/"
randomlinks[8]="http://www.fallingfalling.com/"
randomlinks[9]="http://www.staggeringbeauty.com/"
randomlinks[10]="http://www.trypap.com/"
function randomlink(){
window.location=randomlinks[Math.floor(Math.random()*randomlinks.length)]
}
Html
<form method="post">
<p><input type="button" name="B1" value="Random Link >>" onclick="randomlink()""window.open'"></p>
</form>
or
<a href="javascript:randomlink()">Random Link</a>
So können Sie mir den vollständigen Code sagen, ich benutze und fügen sollte. –
@ IshraqKhan aktualisiert. – SEUH