MDN Web Docs

Syntax

js

get(name)

Parameters

name

A string representing the name of the key you want to retrieve.

Return value

A value whose key matches the specified name. Otherwise, null.

Examples

If we add two username values to a FormData using append():

js

formData.append("username", "Chris");
formData.append("username", "Bob");

The following get() method will only return the first username value:

js

formData.get("username"); // Returns "Chris"

Specifications

Specification
XMLHttpRequest
# dom-formdata-get

Browser compatibility

See also

Help improve MDN

Yes No

Learn how to contribute

This page was last modified on by MDN contributors.

Read the original on developer.mozilla.org ↗