Parse error - Unexpected Token ; Expand Text script

Hello to all,
I have created the expand/collapse text feature to my website following Velo’s instructions found here - https://support.wix.com/en/article/velo-tutorial-expand-text-with-a-read-more-link
I have copied/pasted the code provided in Step 7, but I get a “Parsing error: Unexpected token ;” on the first semicolon (line 4). Needless to say, my multi-state box doesn’t expand when I preview the script.
Suggestions anyone? Thank you in advance.

$w.onReady(
$w("#readMoreButton").onClick(() => {
    $w("#readMoreStatebox").changeState("expandedState");
});

$w("#readLessButton").onClick(() => {
    $w("#readMoreStatebox").changeState("collapsedState");
});
);
$w.onReady(()=>{
    $w("#readMoreButton").onClick(() => {
        $w("#readMoreStatebox").changeState("expandedState");
    });

    $w("#readLessButton").onClick(() => {
        $w("#readMoreStatebox").changeState("collapsedState");
    });
});

Score! Thank you!

1 Like