Search...
onChange( )
Adds an event handler that runs when the multi-state box moves to a new state.
Description
onChange
is fired when the multi-state box moves to a new state. This occurs
when the changeState()
function is called.
Syntax
function onChange(eventHandler: EventHandler): MultiStateBoxeventHandler: function EventHandler(event: Event): void
onChange Parameters
NAME
TYPE
DESCRIPTION
eventHandler
The name of the function or the function expression to run when the multi-state box moves to a new state.
EventHandler Parameters
NAME
TYPE
DESCRIPTION
Returns
This function does not return anything.
Return Type:
void
Related Content:
Was this helpful?
Get the ID of the state to which the multi-state box moved
Copy Code
1$w("#myStatebox").onChange( (event) => {2 let currentState = event.target.currentState.id; // "state2"3} );