Quick start

Using CDN

You can easily start by using the CDN version.

Add the following description in the <head> tag of the web page you want to use FormStorage with.

<script src="https://unpkg.com/form-storage@latest/build/form-storage.min.js"></script>

You can also bundle the library with Browserify or Webpack.

npm install form-storage --save

import FormStorage from 'form-storage'

Wrap the elements you want to apply FormStorage to like this.

<form class="js-form-storage"> <input type="text" name="first-name" /> <input type="text" name="last-name" /> <input type="email" name="email" /> <input type="password" name="password" /> <label> <input type="checkbox" class="js-persist" /> Allow saving form-data to localstorage. </label> </form>

Write the following script