G-Sheet Stack Button - html class or js for new tab

Hi all,

as @weavium.plugins seems awol I ask the good coders here.
I am activating a youtube link with a G-sheet button which pulls the adress from a Google sheet.
I want the youtube link opening in a new tab. The G-Sheet button has the option for a html class.
Can I create a class that can trigger opening the link in a new tab (target="_blank")?
If yes, how?
See screenshot of the stack settings

The link in the Google sheet is just the address so I can’t add target=_blank there.

website is https://www.hundefreunde-europa.de/UnsereHunde/Koerbchen_gesucht/

(Please no discussions about whether it is good or not to force the user to have a new tab opened. Stay with the question. Thanks)

Any helpful thoughts appreciated.


No, you can’t do this in CSS — only in HTML or JS. What you can do, though, is add this to the ‘head’ section of your (page or site) code:

<base target="_blank">

It will make all links on your page/site open in a new window. Then if you don’t want some of your links to do this, you’ll have to explicitly specify target="_self" for each of them to open in the default way.


Thanks James,
that is doing the trick. You made my day!