Skip to content

Commit 4cfe254

Browse files
authored
Update README.md
1 parent b8a09f5 commit 4cfe254

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

README.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
11
# Get-Form-Data-with-JavaScript
22
get data from a FORM with JavaScript
33

4-
5-
// getting the Form element and listener it
6-
document.querySelector('form')
7-
.addEventListener('submit', e => {
8-
// stop the default functions
9-
e.preventDefault()
10-
// store the data in a variable, create new FormData to intruduce the form target data
11-
const data = Object.fromEntries(
12-
new FormData(e.target)
13-
)
14-
// show the Object in a console log
15-
console.log(JSON.stringify(data))
16-
})
4+
info in example.js

0 commit comments

Comments
 (0)