Search...
value
Sets or gets the value of the switch state.
Description
Setting the value
property to true
toggles the switch to the on position. Setting it to false
toggles the switch to the off position.
Getting the value
property returns true
when the switch is on, and false
when the switch is off.
Type:
booleanRead & Write
Was this helpful?
Get the value of the switch state
Copy Code
1let switchValue = $w('#mobileSwitch1').value; // true
Set the value of the switch state
Copy Code
1$w('#mobileSwitch1').value = false;