DOM Methods
FormData.delete()
Removes every entry with the given name. Missing names are harmless; the original form controls are not modified. For repeated checkboxes stored with the same name, deleting that name removes the whole group from this FormData object. To replace only selected entries, reconstruct or filter the entry list. This operation does not submit anything. Example result: false.
Formal Syntax & Structure
html syntaxhtml
data.delete(name)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| name | string | Field name; matching is case-sensitive. |
Return Value
undefined
Undefined; the entry list is modified in place.
Working Example
Example Snippethtml
<p> Result: <output id="result"></output></p><script> const result = document.getElementById("result"); (async () => { const data = new FormData(); data.append("tag", "html"); data.append("tag", "css"); data.delete("tag"); result.textContent = data.has("tag"); })().catch(error => { result.textContent = "Error: " + error.name; });</script>