0

When I click a button, it's supposed to essentially open a random website. When I press the button, it makes me view the opened tab.

I made a JSFiddle https://jsfiddle.net/fL9rpox6/

  <button onclick="
    const random = Math.random();
    var idk = random
    window.open('https://www.bing.com/search?q=scp+agent+'+ idk + '+cool&qs=n&form=QBRE&sp=-1&pq=scp+agent+'+ idk +'+cool&sc=10-3&sk&cvid=3A6D4119FA794E4294E48112AB40166D&ghsh=0&ghacc=0&ghpl&safesearch=strict&adlt=strict', '_blank');
    ">Open</button>

and if you click the button, you see that it forces you to see the new website. Can I make it so I can click the button multiple times without it making me change tabs each time?

None of the answers to the "duplicate" work for me, I have tried all of them.

Doxr
  • 1
  • 3

0 Answers0