How about this…
$w.onReady(function () {
$w("#button").onClick(() => {
if ($w("#hiddentext").collapsed) {
$w(`#hiddentext`).expand();
$w("#button").label = "-";
} else {
$w(`#hiddentext`).collapse();
$w("#button").label = "+";
}
});
});
Note: to be consistent with variable naming conventions in JavaScript, you might want to rename the element ‘hiddentext’ to ‘hiddenText’, using camelcase capitalization.
Here’s the result – before click and after click:

