I want to open a pop-up window using window.open() in JavaScript and immediately focus on the previous page (not the pop-up page). Are there any way I could do it?
Here is the code:
let newwin;
function pop(){
newwin = window.open("https://stackoverflow.com","_blank","width=500,height=500");
setTimeout(()=>{newwin.blur();},0);
}
.blur() to achieve it, but seems not working.
Are there any ways I could do it or not?
Thanks for any responds!