-2

I opened the external URL using javascript. But it opens in the same window I need to open it in new tab

onclick="window.location= '$url';
Sathish Kumar
  • 11
  • 2
  • 3

1 Answers1

1

You can do it by using only html if you want :

<a href="my.link.com" target="_blank"> some text </a>

But by javascript this should work :

onclick="window.open('http://my.link.com', '_blank')"

yank7
  • 29
  • 4