@Megalomaniac and @pgraves and @whatkarensaid First thank you for your code @Megalomaniac, it works very well when you always use the same name ID!
But I have the same need and the same problem. "... when I create more than one, only the first one works. What do I need to change in the header injection code to make it work for multiple buttons with different titles? --- all three buttons work to expand/contract but the buttons all revert to the same text as the first button on the page when collapsed."
I need too more buttons on the same page but with different names ID, I played a bit with the code and have the same as @pgraves, they work but then they reverse to just one of them. Anyone a clue? Please am getting nuts :((Thank you in advance