Web APIs

FormData.get()

Try the free JavaScript compiler

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

NameTypeDescription
namestringField 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);
JavaScript Reference