JSFiddle - React, Tailwind, and code Playground

HTML

<a href="javascript:{pop()};">Click me to open a new popup OR focus on the existing one</a>

JavaScript

var win=null;

function pop(){
    if(win!== null && !win.closed) {
        //If it's already open, just focus on it
        win.focus();    
    }else {
        //Otherwise, make a new window and go to it
        win= window.open("http://google.com");
    }
}