FormData.keys()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

We’d love to hear your thoughts on the next set of proposals for the JavaScript language. You can find a description of the proposals here.
Please take two minutes to fill out our short survey.

Note : Cette fonctionnalité est disponible via les Web Workers.

La méthode FormData.keys() renvoie une itération permettant de parcourir toutes les clés contenues dans cet objet. Les clés sont des objets USVString.

Note : Cette méthode est disponible dans les Web Workers.

Syntaxe

js
formData.keys();

Valeur de retour

Retourne une itération.

Exemple

js
// Créer un object FormData test
var formData = new FormData();
formData.append("cle1", "valeur1");
formData.append("cle2", "valeur2");

// Affiche les clés
for (var key of formData.keys()) {
  console.log(key);
}

Le résultat est :

cle1
cle2

Spécifications

No specification found

No specification data found for api.FormData.keys.
Check for problems with this page or contribute a missing spec_url to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.

Compatibilité des navigateurs

Voir aussi