title: Dynamically add file input to form
body: <p>I am working on an email script that is able to send multiple attachments. Currently I just have 3 file inputs in it which look like this:</p>
  
  <p><img src="https://i.stack.imgur.com/4O2hz.jpg" alt="translated: select a file/no file selected and Verstuur = Send"></p>
  
  <p><em>translated:</em> <kbd>Select a file</kbd> <strong>No file selected</strong> <em>and Verstuur =</em> <kbd>Send</kbd></p>
  
  <p>The script itself works fine and it is able to send multiple attachments but I would like to have just 1 file input to select a file and create a button or a link which will add another file input so the user himself can select as many attachments as he needs. I have searched on this forum and on google and I found out that it is possible using jquery. I have never used jquery before and I can't figure out how to do it by myself. If someone can explain how to do it or has any tips it would be great.</p>
  
  <p>The html form I have now basicly included this now:</p>
  
  <pre><code>    &lt;input type="file" name="attachment[]"&gt;&lt;br/&gt;
      &lt;input type="file" name="attachment[]"&gt;&lt;br/&gt;
      &lt;input type="file" name="attachment[]"&gt;&lt;br/&gt;&lt;br/&gt;
      &lt;input type="submit" value="Verstuur" name="submit" &gt;&lt;br/&gt;
  </code></pre>
  
  <p><strong><em>Edit</em></strong>: I got it figured out using <a href="http://edrupler.com/jQuery%E2%80%93Dynamically-Adding-Form-Elements" rel="nofollow noreferrer">this</a></p>