Hi Melissa ,
Your code is fine and the slice works well, but you’re missing to assign the sliced value to the $w(“#text49”)
so, it should be like this :
if ($w("#text49").text.length > 300){
$w("#text49").text =$w("#text49").text.slice(0, 20) ;
Hope this helps!
Best,
Mustafa