I followed the tutorial and have gone over several peoples input in this forum and I can not get the code to work. The site is not published yet but when I go into preview mode, the text box does collapse as it should. However, when I click the “Show More” button it doesn’t respond at all. I would greatly appreciate someone checking out my code.
let fullText;
let shortText;
$w.onReady( function () {
const shortTextLength = 918;
fullText = $w(“#text8”).html;
shortText = fullText.substr(0, shortTextLength) + “…”;
$w(“#text8”).html = shortText;
});
export function button2_click(event, $w) {
if ($w(“#text8”).html.length < fullText.length) {
$w(“#text8”).html = fullText;
$w(“#button2”).label = “Show less”;
} else {
$w(“#text8”).html = shortText;
$w(“#button2”).label = “Show more”;
}
}