It seems browsers keep data for example those entered in an input box. I was looking to see if we can keep such intermittent data in the same way browsers do!
It would be interesting to know why you have this objective
This may be fragile since it would be easy to give more than one html tag the id=“toggle”, targeting a class may be better.
Not without a temporary tiddler, but somewhat minimalist is to use the popup parameter on a button which creates the temp-tiddler and deletes the tiddler on the subsequent click.
However inside this solution may be a path to achieving what you want See “conditional css inside the buttons using the popup.”
The display component just tests if the [[tiddlername]has[title]]
Then you choose the tiddler title you use $:/state $:/temp prefixes to determine if its saved or not.
I invented a css class based details toggle demo here and the macros here, where I use conditional css inside the buttons using the popup.