Last active
March 6, 2023 02:28
-
-
Save daanta-real/3a0d544ec3b3700705670bbee6870546 to your computer and use it in GitHub Desktop.
Read and print all form data to console
This file contains hidden or 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
function printFormData(formId) { | |
const formEl = document.getElementById(formId); | |
const formData = new FormData(formEl); | |
const params = {}; | |
for(const [key, val] of formData.entries()) { | |
params[key] = val; | |
} | |
console.table(params); | |
console.log(JSON.stringify(params)); | |
alert("FORM 출력됨"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment