The delete()
method of the FormData
interface deletes a key and its value(s) from a FormData
object.
Note: This method is available in Web Workers.
Syntax
formData.delete(name);
Parameters
name
- The name of the key you want to delete.
Returns
Void.
Example
The following line creates an empty FormData
object and prepopulates it with key/value pairs from a form:
var formData = new FormData(myForm);
You can delete keys and their values using delete()
:
formData.delete('username');
Specifications
Specification | Status | Comment |
XMLHttpRequestThe definition of 'delete()' in that specification. | Living Standard |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
delete
|
Chrome
Full support 50 |
Edge
Full support 18 |
Firefox
Full support 39 |
IE
No support No |
Opera
Full support Yes |
Safari
Full support 11 |
WebView Android
Full support Yes |
Chrome Android
Full support 50 |
Firefox Android
Full support Yes |
Opera Android
Full support Yes |
Safari iOS
No support No |
Samsung Internet Android
Full support 5.0 |
Legend
- Full support
- Full support
- No support
- No support
See also
FormData.delete() by Mozilla Contributors is licensed under CC-BY-SA 2.5.