title: FormData to dynamic created elements
body: <p>I don't understand why I can't send file via xhr from the dynamic created element. There is my code:</p>
  
  <pre><code>            $('#thread_file').prepend('&lt;form action="/nti/'+$time+'" enctype="multipart/form-data" method="post"&gt;&lt;div class="picture" style="text-align:right;height:30px;line-height:15px;"&gt;change file&lt;/div&gt;&lt;input type="hidden" name="thread" value="a" /&gt;&lt;input class="file" data-thread="a" type="file" name="file" accept="image/*" style="display:none!important;" /&gt;&lt;progress value="0" min="0" max="100"&gt;0%&lt;/progress&gt;&lt;/form&gt;');
                  $('form').on('click','.picture',function(){$(this).parent().find('.file').click();});
                  $('form').on('change','.file',function(){
                      var $form = $(this).parent();
                      var data = new FormData($form);
                      var xhr = new XMLHttpRequest();
                      var $progress_bar = $form.find('progress');
                      xhr.open('post',$form.action);
                      xhr.onload = function(e)
                      {
                          $form.parent().find('.thread_file').html(e.currentTarget.responseText);
                      };
                      xhr.upload.onprogress = function(e) 
                      {
                          $progress_bar.val(e.loaded/e.total*100);
                      };
                      xhr.send(data);
                      return false;
                  });
  </code></pre>