Search...
onChange( )
Adds an event handler that runs when the tabs element moves to a different tab.
Description
onChange()
runs when the tabs element moves to a different tab. This occurs
when you call the changeTab()
function or when a site visitor clicks on a tab menu item.
Syntax
function onChange(eventHandler: EventHandler): voideventHandler: function EventHandler(event: Event): void
onChange Parameters
NAME
TYPE
DESCRIPTION
eventHandler
The name of the function or the function expression to run when the tabs element moves to a different tab.
Returns
This function does not return anything.
Return Type:
void
EventHandler Parameters
NAME
TYPE
DESCRIPTION
Returns
This function does not return anything.
Return Type:
void
Related Content:
Was this helpful?
Get the label of the tab to which the tabs element moved
Copy Code
1$w("#myTabsElement").onChange((event) => {2 let currentTabLabel = event.target.currentTab.label; // "Second Tab"3});