How to Close Text Element with Code

We are looking for a code example to simply close a text element. We have found sample code to close a Lightbox but it does not work on simple text. Any help would be great.
]//thanks//

You can’t close elements with text in them, you can however use show or hide and collapse or expand.
https://www.wix.com/corvid/reference/$w.HiddenCollapsedMixin.html
https://www.wix.com/corvid/reference/$w.CollapsedMixin.html