The saveHistory behavior saves the current state of the page when the user navigates away from the page. When the user returns to the page by pressing the back or forward button, the values are restored.
The saveHistory behavior persists only for the current session. When the user navigates away from the page containing the saveHistory behavior, the data is persisted in a UserData store. The saveHistory behavior uses one UserData store for the entire document. Thus, if two elements write the same attribute, the first is overwritten by the second. The UserData store is saved in an in-memory stream and is not saved to disk. Therefore, it is not available after the user closes Microsoft® Internet Explorer.
For example, a page with several dynamically updated styles might save these updates using the onload and onsave event handlers. The style values can be saved as attributes when onsave fires, and restored when onload fires.
To use the saveHistory behavior, use a meta tag that identifies the type of persistence.
<META NAME="save" CONTENT="history">
The required style can be set inline or in the document header, as follows: