Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // run this in the terminal to save the state of all inputs
- // in your browser's LocalStorage:
- [].forEach.call(document.querySelectorAll("input"), function(el) {
- localStorage.setItem(el.name, el.value);
- });
- // then refresh the page and run this to restore your form values:
- [].forEach.call(document.querySelectorAll("input"), function(el) {
- el.value = localStorage.getItem(el.name);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement