How Can I Create a Button that links to multiple websites randomly?

后端 未结 1 1931
长情又很酷
长情又很酷 2021-01-29 09:49

I just wanted to know how can I create a button that can take a person to multiple websites in a random order when it is clicked each time. I do not want these websites to open

1条回答
  •  臣服心动
    2021-01-29 10:31

    Make a JS array with the target URLs, and randomly pick from it when the button is clicked.

    Here is a working example:

    
    

    And here is a link with this onClick handler assigned.

    Gimme something weird!
    

    You can style it to look like a button, if you want.


    Just FYI the crazy links come from TheUselessWeb's list.

    0 讨论(0)
提交回复
热议问题