1

I want to open a new page with this :

window.open(); but I don't want to lose focusing current screen.

How can I handle this ?

rnn
  • 2,393
  • 3
  • 21
  • 39
  • Does this answer your question? [I need to open a new window in the background with JavaScript, and make sure the original is still focused](https://stackoverflow.com/questions/2181464/i-need-to-open-a-new-window-in-the-background-with-javascript-and-make-sure-the) – Alejandro Feb 16 '22 at 13:06
  • @Alejandro I tried them but they didnt work – rnn Feb 16 '22 at 13:19

1 Answers1

0

Question is not that much clear???? You need this functionality in React or in Plain HTML webpage ??

<html>
<body>
    <p>Click the button to open a new tab </p>

    <button onclick="NewTab()">
    Open Geeksforgeeks
</button>

    <script>
        function NewTab() {
            window.open(
            "https://www.geeksforgeeks.org", "_blank");
        }
    </script>

</body>
</html>