Search code examples
htmlhref

HTML How to open this URL in new window?


This is the code:

<a href="FAKE_URL" onclick="document.location.href = 'REAL_URL'; return false;">
<img src="IMAGE"></a>

I have already tried:

<a href="FAKE_URL" onclick="document.location.href = 'REAL_URL'; return false;" target="_blank">
<img src="IMAGE"></a>

but not working


Solution

  • Try this:

    <a href="../html-link.html" target="popup" onclick="window.open('../html-link.html','name','width=600,height=400')">Open page in new window</a>