FormData 接口的 delete() 方法会从 FormData 对象中删除指定键,即 key,和它对应的值,即 value。

Note: 此方法可用于 Web Workers

语法

formData.delete(name);

参数

name
要删除的键(Key)的名字。

返回

空。

例子

以下代码将会创建一个空的 FormData 对象, 并且从指定的表单中获取键值对:

var formData = new FormData(myForm);

你可以通过 delete() 方法来删除键值对:

formData.delete('username');

规范

说明 状态 备注
XMLHttpRequest
delete()
Living Standard  

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
deleteChrome Full support 50Edge Full support 18Firefox Full support 39IE No support NoOpera Full support YesSafari Full support 11WebView Android Full support YesChrome Android Full support 50Edge Mobile No support NoFirefox Android Full support YesOpera Android Full support YesSafari iOS No support NoSamsung Internet Android Full support Yes

Legend

Full support  
Full support
No support  
No support

参见

文档标签和贡献者

标签: 
此页面的贡献者: mdnwebdocs-bot, RainSlide, stevobm, tomi-li
最后编辑者: mdnwebdocs-bot,