Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.

Well done!

You have completed (UPI) Chapter 10: Utilizing Forms with JavaScript!

Instruction

Associating a FormData Object and a <form>

If the data you're submitting is really coming from a &lt;form&gt;, you can populate the FormData instance by passing the form into the FormData constructor.

Suppose our HTML declares a &lt;form&gt; element:

&lt;form id=&quot;userinfo&quot;&gt;
  &lt;div&gt;
    &lt;label for=&quot;username&quot;&gt;Enter your name:&lt;/label&gt;
    &lt;input type=&quot;text&quot; id=&quot;username&quot; name=&quot;username&quot; value=&quot;Dominic&quot; /&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;la...