Staying Alive

Prevent your users' hard-earned text from disappearing if they leave the page.



That's really it. Each form element on the page requires an ID for the persistence to work. If you don't want to persist every input on a form, you can also call stayAlive on an individual input element.

If you need additional control, stayAlive accepts an options object:

A string that identifies the current page, and distinguishes it from other pages on your domain. (default: window.location.pathname)
The maximum time, in milliseconds, for which a saved value will be kept.


Type text in the form below, and then reload the page. You won't have lost anything! Submitting the form clears the stored values.

A critically important form