MDN self-hosted library · e01.org

FormData: set() method

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

js
formData.set("username", "Chris");
js
formData.set("user-pic", myFileInput.files[0], "chris.jpg");
js
formData.set("name", 72);
formData.get("name"); // "72"