Explanation:
The markup consists of a button to toggle the spoiler text and a div which contains the said text. Upon clicking at the button it will access the div containing the spoiler text, check it's display status and change it to show/hide it. That's it :)