Skip to content

Use localstorage to remember input values. Supports textareas and inputs including radio buttons and checkboxes.

Notifications You must be signed in to change notification settings

matthewmueller/remember

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

remember

Use localstorage to remember input values. Supports textareas and inputs including radio buttons and checkboxes.

Example

var remember = require('remember');

remember()
  .except('input[type=password]');

Installation

$ component install matthewmueller/remember

Design

This library uses document-level event delegation to capture input. This allows for efficient and "live" bindings. The caveat to this approach is that if you use e.stopPropagation() within another input binding, remember's bindings will not trigger and the input will not be saved.

API

Remember([options])

Initializes remember and pulls in the previously stored values. Options include:

  • namespace: used to namespace the values in localstorage. Defaults to remember:.

.except(selector)

Excludes elements that match the selector.

.clear()

Clears localstorage

.unbind()

Unbinds all textareas and inputs.

Special Thanks

Garlic.js was the source of inspiration for this project and a good reference.

License

MIT

About

Use localstorage to remember input values. Supports textareas and inputs including radio buttons and checkboxes.

Resources

Stars

Watchers

Forks

Packages

No packages published