Opening a Link in NEW Window

ursnani
Giga Guru

HI,

I have a SR which needs to display a couple of links.

I have used Macro for displaying those links, but the issue is when i click those links they are opening on the same window, i dont want that to happen. When the user clicks the link should oopen in a new window or new tab.

I know there is a way to achievie this and i was trying to remember thatbut i was unable to ?

Can anyone please help me?

1 ACCEPTED SOLUTION

Jon Barnes
Kilo Sage

if you are using an anchor "<a>" element, you can use target, like this: <a target="_blank" href="whatever">my link</a>. Keep in mind, modern browsers now seem to frown on this because they want the user to control where the link opens, and if the browser doesn't allow popups on your site, the user may not notice the browser has blocked a popup.



However, most browsers still support this convention.


View solution in original post

5 REPLIES 5

Alikutty A
Tera Sage

You would require to set the target attribute on your anchor tag used for rendering the links.



<a href="https://www.w3schools.com" target="_blank">Visit W3Schools</a>



target="_blank" opens the link in a new window



HTML a target Attribute



Thank You


Please Hit Like, Helpful or Correct depending on the impact of response