Created
November 28, 2019 21:35
-
-
Save mscalora/24f20f7816ab6af6ad26bff819a22925 to your computer and use it in GitHub Desktop.
Save and restore form contents in the js console
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// save: | |
localStorage.temp = JSON.stringify(Array.from(document.querySelectorAll('input')).map(x => {console.log(x.value); return x.value})) | |
// restore: | |
JSON.parse(localStorage.temp).forEach((x,i) => document.querySelectorAll('input').item(i).value = x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment