Skip to content

Commit

Permalink
formData
Browse files Browse the repository at this point in the history
  • Loading branch information
serikshaikamalov committed Jul 3, 2024
1 parent 8a82271 commit ff47166
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,14 @@ export class Basket extends LitElement {
}
customElements.define("app-basket", Basket);
```

## Get form values in one shot

```js
submit(e){
e.preventDefault()
const formData = new FormData(e.target)
const formProps = Object.fromEntries(formData)
// {a: 1, b: 2}
}
```

0 comments on commit ff47166

Please sign in to comment.