Created multistate box w/2 states to display different pricing points for the same subscription. Won't show prices when click buttons. Help.

Here is the code I used:
$w( “#button19” ).onClick(() => {
$w( ‘#statebox8’ ).changeState( “state1” );
} );
$w( “#button20” ).onClick(() => {
$w( ‘#statebox8’ ).changeState( “state2” );
});
$w( “#button27” ).onClick(() => {
$w( ‘#statebox8’ ).changeState( “state1” );
} );
$w( “#button26” ).onClick(() => {
$w( ‘#statebox8’ ).changeState( “state2” );
} );

Put all of this inside:

$w.onReady(() => {
//here
})

And make sure the property IDs are correctly spelled ,

Thank you for trying to help, J.D. I now tried the code below, adding your suggestions correctly (or so I think.) It still returns nothing when I click on the two “tab buttons” that are supposed to switch the look of the multistate box. I double-checked the spelling of the IDs and have them right. Do I not have the code in the right order or something? Does my site need to be live to see the changes rather than preview mode? Any insight is much appreciated!

$w.onReady(() => { //$w(" #button19 ").onClick(() => { $w( ’ #statebox8 ’ ).changeState( “State1” ); }); $w( " #button20 " ).onClick(() => { $w( ’ #statebox8 ’ ).changeState( “State2” ); }); $w( " #button27 " ).onClick(() => { $w( ’ #statebox8 ’ ).changeState( “State1” ); } ); $w( " #button20 " ).onClick(() => { $w( ’ #statebox8 ’ ).changeState( “State2” ); });

@flatthead remove the // and add }) in the end.