Hi Team,
Any ideas why my dataset connected (URL is stored in dataset) button not open the link in a new tab. From the support documentation its supposed to?!? And I don’t see any option to make it do so. I want it too as it’s external URL’s and I don’t want people actually leaving my site.
https://www.fruitfool.co.nz/fruit/golden-delicious (my site)
/article/connecting-a-button-to-a-content-collection (wix documentation)
→ Fields
Link to a URL, file, image, or video field in your collection. If you link to a URL field, that page is opened in a new tab . If you link to a file, image, or video field, the media stored in that field is downloaded to your visitor’s device.
You want to set the Button’s target property . Something like this:
$w("#button1").target = "_blank";
$w("#button1").link = "https://www.wix.com";
Note: sometimes the browser doesn’t allow this. Different browser behave differently, and there might be setup of configuration settings.
Okay I’ll give that a go. Just to clarify though - the link is working - but it opens in same tab (meaning user would leave my site as the URL is external). I thought the documentation states it should open in new tab. I will try your solution and see how I go. Was trying to avoid using the coding and just use the wix functionality. Thanks 
Actually trying again today it IS opening in a new tab - so perhaps I was just mistaken yesterday. All working as expected without using Code.
Yisrael , I found a Wix document that says the target property doesn’t work for internal pages on the Wix site. “Note: Link targets are only supported for external web links (e.g. http://www.wix.com).".”) Is this still true? I actually have the opposite problem to that presented here. On my dynamic pages I’ve got URLs to internal pages. These links open new browser tabs, which is bad for user experience.
I found a forum post with a Javascript code that for some people works to open the new page in the same browser tab, but it doesn’t work for me.
$w(“#element1”).target = “_self”;
https://community.wix.com/velo/forum/coding-with-velo/repeater-open-link-in-same-window?_gl=11of7tsi_ga*MTYxNjQyMTcxMi4xNjc1MTEzODQ5
I’m wondering whether it’s not working for me because Wix doesn’t support targets for internal site pages.