Can I change the text of a button when the button is clicked?

I have a button that I’m using for a dynamic collapse. I would like to have the button change from something like “Open …” to open the collapse region to “Close …” to close the collapse region. So basically I’m looking for a way to change the button text based on the open or close status of the collapse region.

Community Page
Last updated: