Skip to content

Instantly share code, notes, and snippets.

@mscalora
Created November 28, 2019 21:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mscalora/24f20f7816ab6af6ad26bff819a22925 to your computer and use it in GitHub Desktop.
Save mscalora/24f20f7816ab6af6ad26bff819a22925 to your computer and use it in GitHub Desktop.
Save and restore form contents in the js console
// 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