Changing text dynamically

I have created a text "Expand details", clicking on which, it will show a hidden text. Now after clicking it, I want that clickable text to be changed as "Hide details" dynamically. How can I do?I have created a text "Expand details", clicking on which, it will show a hidden text. Now after clicking it, I want that clickable text to be changed as "Hide details" dynamically. How can I do?

Discussions have been disabled for this post