Making Multi-State Box work

Trying to make it work and my error " changeState does not exist on #box1"

$w( “#buttonState1” ).onClick(() => {
$w( ‘#Box1’ ).changeState( “state2” );
});

$w( “#buttonState1” ).onClick(() => {
$w( ‘#Box2’ ).changeState( “state1” );
});

Without any comments,
this should be understandable… take a look…
https://russian-dima.wixsite.com/meinewebsite/multistate-boxes

Hi Russian Dima,

How would this work if I would like to redirect from another page on my website?
For example, I have a home page with a button that using WixLocation and # redirects to that BoxID on the other page. Could I in this case also specify a specific state to be opened? In my case I have a collapsed (default) and expanded state, but I cant seem to open the page with the expanded state displayed.
Thanks in advance