issue with Switches plz help

i have same code with old website is working fine
but my new website not working

with i change the switch to on or off it show or hide element

export function switch1_change() {
if ( $w('#switch1').checked ){
  $w('#input1').show();
  $w('#input2').show();
  $w('#loginButton').show();
  $w('#button1').hide();
  $w('#text48').show();
      $w('#text49').hide();
     $w('#input3').hide();
     $w('#button3').hide(); 
}
else {
  $w('#text48').hide();
  $w('#input1').hide();
  $w('#input2').hide();
  $w('#loginButton').hide();
  $w('#button1').show();
      $w('#text49').hide();
     $w('#input3').hide();
     $w('#button3').hide(); 
}
 
}

Br

What isn’t working? Do you have errors in the Developers console?

no errors in the Developers console

i think wix remove onChange event for Switches ?

You should use onClick() .

ok now it working thanks Yisrael