kirilla / checkbox_localstorage

Personal checkboxes on a web page, stored in the browser.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

checkbox_localstorage

A javascript snippet that stores checkbox state in localstorage in the browser.

With this you can create simple static webpages for personal checklists.

What is it good for

  • You want to publish checklists in a central location for many people to use.
  • The checklists are mostly static content.
  • You don't care about the checkmark status of your checklist users.
  • The users have no need to share their checkmark status with anyone else.

How to use it

  1. Create a web page.
  2. Load the checkur.js file.
<head>
    <script src="checkur.js"></script>
</head>
  1. Initialize the checkur.js script at the end of the page body.
<body>
  ...

  <script>
  Checkur.init("checkur");
  </script>
</body>
  1. Add the classname and a unique id to your inputs.
<body>
  <input type="checkbox" class="checkur" id="123">
  <input type="checkbox" class="checkur" id="foo123dj">
  <input type="checkbox" class="checkur" id="h23o4o">
</body>
  1. Does it work? (See comment in webpage.)

About

Personal checkboxes on a web page, stored in the browser.

License:MIT License


Languages

Language:CSS 78.8%Language:HTML 13.0%Language:JavaScript 8.2%