This time I will share jQuery Plugin and tutorial about jQuery Plugin To Persist Checkbox State Using Local Storage, hope it will help you in programming stack.
File Size: | 5.38 KB |
---|---|
Views Total: | 2013 |
Last Update: | |
Publish Date: | |
Official Website: | Go to website |
License: | MIT |
Persistent Checkboxes is a dead simple jQuery plugin that temporarily stores checkbox states in local storage using HTML5 Web Storage API and restore them when needed (refresh the web).
How to use it:
1. Load the Persistent Checkboxes plugin’s JavaScript file after jQuery library and we’re ready to go.
1 |
< script src = "//code.jquery.com/jquery-3.1.1.slim.min.js" ></ script > |
2 |
< script src = "persistent-checkboxes.js" ></ script > |
2. Add unique IDs to your existing checkboxes and we’re done. The plugin will load any saved check boxes and place a listener on checkbox changes, saving the status of every checkbox as it changes.
1 |
< input type = "checkbox" id = "checkbox-1" checked> |
2 |
< input type = "checkbox" id = "checkbox-2" > |
This awesome jQuery plugin is developed by hafeild. For more Advanced Usages, please check the demo page or visit the official website.
source : jqueryscript.net