Help opening link in another window

Hi anyone help why this link is not opening in different window,

https://codepen.io/gurpreet_singh9189825/pen/bGwPRON

Hello @Gurpreet_Singh
You need to add target="_blank" attribute to the a tag if you want it to open in a new window.

Hi, if i use only popUp function its working perfectly but with prepareLink function i dont know what is happening to it

Can you be more specific about what it is that you want to do? Do you simply want to open a link in another page or there is something else you want to do? I have seen your JS code but I don’t quite know its purpose.

Hi, all its purpose is to open link in new window through popup function via preparelink function , on window load preparelink is executing which inturn executing popup, could you suggest why link is not opening in new window even i have used window.open method and there is no use of target=“blank” if i execute popup function passing it a attribute it works but i need to work both functions

“To open a new window on every call of window.open() , use the special value _blank for windowName .”

see this code this is working perfectly----

<a onclick="popUp(this.href);" href="https://www.google.com/">google</a>

function popUp(winURL){ window.open(winURL,"pop","width=320,height=480"); }

@nibble @bbsmooth hi, i found the problem
actually it is className not classname in the function,
thanks guys you did your best