For security reasons, almost all interactive elements (e.g. button) and javascript attributes (e.g. onclick) get sanitised when you save them to itch—depending on what they are, they either get deleted or converted to regular text. At the moment, the easy way to do this would be using details-summary widgets, like this (you'll need to style them yourself, though):
<details> <summary>Click me...</summary> <p>...and this text will appear.</p> </details>