Skip to content

Commit ff47166

Browse files
formData
1 parent 8a82271 commit ff47166

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

readme.md

+11
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,14 @@ export class Basket extends LitElement {
206206
}
207207
customElements.define("app-basket", Basket);
208208
```
209+
210+
## Get form values in one shot
211+
212+
```js
213+
submit(e){
214+
e.preventDefault()
215+
const formData = new FormData(e.target)
216+
const formProps = Object.fromEntries(formData)
217+
// {a: 1, b: 2}
218+
}
219+
```

0 commit comments

Comments
 (0)