Search.../

id

Gets the state's ID.

Description

The ID is the state's unique identifier. It is used when selecting the state using the $w() function.

An state's id is set in the Editor using the Properties panel. To set the state id:

  1. Click the multi-state box.
  2. Navigate to the state you want to edit.
  3. Edit the STATE ID field in the Properties panel.

State ID

Type:

stringRead Only

Was this helpful?

Get the current state and its ID

Copy Code
1let state = $w("#myStatebox").currentState;
2
3let stateId = state.id; // "state1"