Toggling two switches together

Wondering if anyone can help me toggle these switches together? I’ve tried various combinations but can’t seem to get them to toggle together.

export function switch1_change(event) {
 if( $w("#switch1").checked ) {
        $w('#switch2').checked === true
        $w("#YesPricesText").show();
        $w('#noAccommodationText').hide();
  
}
else {
        $w('#switch2').checked === false
        individualPrice()
        $w("#YesPricesText").hide();
        $w('#noAccommodationText').show();
}
}

Thank you!

Hello Stephen,

the triple = sign checks to see if they equal each other, you want to use just one = sign to assign it to true or false.

$w(’ #switch2 ').checked = false

Goodluck!
Majd

@mqumseya Thank you! It works, I must’ve had some other code affecting this yesterday as I tried this… but it’s working now! Thank you :slight_smile:

Hi, check this video out on how to toggle between boxes - YouTube