Answers for "console form elememts as json object"

0

console form elememts as json object

function handleSubmit(event) {
    event.preventDefault();

    const data = new FormData(event.target);

+   const value = Object.fromEntries(data.entries());

    console.log({ value });
  }

  const form = document.querySelector('form');
  form.addEventListener('submit', handleSubmit);
Posted by: Guest on September-10-2021

Code answers related to "console form elememts as json object"

Code answers related to "Javascript"

Browse Popular Code Answers by Language