Targeting Tabs directly from JS

I’d like to use JS logic to determine which tab to show (it’s complicated), rather than via a direct button press/NoCode. I’ve got the SA5 libraries up and running, but I can only seem to get a reference to a Tab object by listening for the tabChanged event. Is there a way to give a Tab element a variable name at author time/in Webflow and target it directly from code?


IMPORTANT
If you want support, please make certain to include-

  1. Your project’s read-only link.
    https://university.webflow.com/article/sharing-your-sites-read-only-link
  2. A link to your published project ( webflow.io is fine )
  3. Details on exactly where to look on your site for the problem you’re describing

Hi @serendipitist

You would just initialize tabs, and then use currentIndex to choose which tab you want.
You I think you should also be able to assign names also with [wfu-tab] and then set the name to select a named tab.