Can you add javascript for a button click that will close the current tab?

adding code into velo I want to be able to click an added button to close a current tab.

$w(“#button1”).onClick(() => {
// Close the current tab
window.close();
});

What do you mean by closing a current tab exactly ?

Are you talking about a …

  1. LIGHTBOX
  2. PAGE

…???

Some pics, which you can provide → to explain your setup a little bit more in detail ?

1 Like

The window tab.

I think this is not possible, but not sure.

  1. You can open a page in a new tab in Wix.
  2. But you can’t close a current tab as of my knowledge.

You can read this, i don’t think that this information is already outdated…

  1. Maybe there are other solutions for your problem, like for example using a LIGHTBOX instead ? You can control a LIGHTBOX completely by code.

  2. Or another approach…
    New Feature: Tabs with no Code

Surely you will find more informations inside this forum, if you do a closer research.