How to open a wixLocation.to(url) in a new tab/window

I have a button that when I press it i want it to navigate to a url (for this im using [wixLocation.to("the](wixLocation.to(“the) url”) but how do I have it open in a new tab. Subsequent code runs after this navigation to “the url” but cannot run if “the url” is opened in the current tab.

https://russian-dima.wixsite.com/meinewebsite/website-navigation

You cannot .
You can only use target “_blank” with links.
If you need to open a new window without having a linked button or a linked text, you’ll have to do it using custom element and window.open() method.

Try set the button.link to the new url full format ("http://…) and the button.target = ‘_blank’.

This example should help you get started: https://www.wix.com/velo/forum/tips-tutorials-examples/opening-a-url-in-a-new-tab-while-running-additional-code

+keep in mind that if it is not a reaction for direct actions (click), some browsers (such as Firefox) will block it.