Re-open dialog reverts back to original state?

Re-open dialog reverts back to original state?

I have a modal dialog box that pops up when a link is clicked. Inside
this dialog, I have some content hidden by default. I have a toggler
button to show the hidden content within the dialog. If I toggle and
show the hidden content, then close the dialog, when I re-open the
dialog, the content goes back to being hidden.
Is there a way to re-open the dialog with the exact same content/info
shown as when it was closed? In other words, how do I prevent the
dialog from resetting back to the original state when I re-open it?
--