Skip to content

Instantly share code, notes, and snippets.

@aletoropov
Last active February 22, 2024 17:20
Show Gist options
  • Save aletoropov/b22a42fc8bef5b501fbf931fd2d4b096 to your computer and use it in GitHub Desktop.
Save aletoropov/b22a42fc8bef5b501fbf931fd2d4b096 to your computer and use it in GitHub Desktop.
Слушатель события отправки формы
document.querySelector('form').addEventListener('submit', (e) => {
e.preventDefault()
const data = Object.fromEntries(new FormData(e.target).entries());
console.log(data)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment