Web APIs

FormData.append()

Try the free JavaScript compiler

Add another entry without replacing existing entries with the same name. Values are strings or Blob objects; filename applies to a Blob. Example console output: ["red","blue"].

Formal Syntax & Structure

javascript syntaxjavascript
data.append(name, value[, filename])

Parameters & Attributes

NameTypeDescription
namestringField name.
valuestring or BlobEntry value.
filenamestringFilename for Blob entries.

Return Value

undefined

No result value.

Working Example

Example Snippetjavascript
const data=new FormData(); data.append("tag","red"); data.append("tag","blue"); console.log(JSON.stringify(data.getAll("tag")));
JavaScript Reference