Persistent state plugin

Put persist on an input to restore and save its value in localStorage. Use the attribute value as the storage key; otherwise its id is used.

Plugin code