im creating a random link href button, i want to make button that can go to different ID.
<a href="#comment">this one is working</a>
function randomlinks(){
var myrandom=Math.round(Math.random()*2)
var links=new Array()
links[0]="#commentsection"
links[1]="/#commentsection"
links[2]="http://www.example.com/#commentsection"
window.location=links[myrandom]
}
<form>
<input type="button" value="Random ID" onClick="randomlinks()">
</form>