Skip to content

Commit 83f4c72

Browse files
authored
reset the form on submit
1 parent 6eccc26 commit 83f4c72

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ update()
4141
form?.addEventListener('submit', async e => {
4242
e.preventDefault()
4343

44-
const data = new FormData(e.target)
44+
const data = new FormData(form)
4545
const text = data.get("message")
4646
const time = Date.now()
4747

@@ -75,5 +75,6 @@ form?.addEventListener('submit', async e => {
7575

7676
update()
7777

78+
forn.reset()
7879

7980
})

0 commit comments

Comments
 (0)