Skip to content

Instantly share code, notes, and snippets.

@araphiel
Last active October 30, 2020 14:40
Show Gist options
  • Save araphiel/a90762187a9e4e18c1e409b979a69ce3 to your computer and use it in GitHub Desktop.
Save araphiel/a90762187a9e4e18c1e409b979a69ce3 to your computer and use it in GitHub Desktop.
Grab fields from a form
Object.values(document.forms[0]).reduce((obj,field) => { obj[field.name] = field.value; return obj }, {})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment