-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
53 lines (36 loc) · 915 Bytes
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
title: FormData.delete()
slug: Web/API/FormData/delete
page-type: web-api-instance-method
tags:
- API
- FormData
- Method
- Reference
- XMLHttpRequest
browser-compat: api.FormData.delete
---
{{APIRef("XMLHttpRequest")}}
The **`delete()`** method of the {{domxref("FormData")}} interface deletes a key and its value(s) from a `FormData` object.
> **Note:** This method is available in [Web Workers](/en-US/docs/Web/API/Web_Workers_API).
## Syntax
```js
delete(name)
```
### Parameters
- `name`
- : The name of the key you want to delete.
### Return value
None ({{jsxref("undefined")}}).
## Examples
You can delete a key and its values using `delete()`:
```js
formData.delete('username');
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- [Using FormData objects](/en-US/docs/Web/API/FormData/Using_FormData_Objects)
- {{HTMLElement("Form")}}