Web APIs
FormData.get()
Return the first entry with the given name, not an array of all values. Example console output: red true.
Formal Syntax & Structure
javascript syntaxjavascript
data.get(name)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| name | string | Field name. |
Return Value
string or File or null
First matching value or null.
Working Example
Example Snippetjavascript
const data=new FormData(); data.append("tag","red"); data.append("tag","blue"); console.log(data.get("tag"),data.get("missing")===null);