title: append() in jquery does'nt append file second time
body: <p>I have defined an input of type file and a hidden form below it,</p>
  
  <pre><code>&lt;input type="file" name="attachment0" id="attachment0" custom-on-change="uploadfile" ng-show="attachFile" multiple/&gt;
  &lt;form class="hidden" id="myForm" method="post" enctype="multipart/form-data" action="SupportRequest"&gt;                                 
  &lt;/form&gt;
  </code></pre>
  
  <p>"custom-on-change" is an angular directive that calls the function uploadfile() after choosing files. My javascript looks as shown below</p>
  
  <pre><code>var form = $('#myForm');
  var n=0;
  $scope.attachFile = true;
  
  $scope.uploadfile = function() {                                        
                  if(n == 0){
                  var filein = $('#attachment0');
                  form.append(filein);
                  $('#attachment0').test();
                  }
                  else
                      {
                      if(n==1){
                      var temp = "attachment0" + '_' + n;
                      var file_in = $('#'+temp);
                      form.append(file_in);
                      $('#'+temp).test();}                        
                      }
              };
  
  $.fn.test = function() {
                    return this.each(function(){
                      n++;
                      $(this).attr('id',   this.id + '_' + n);
                      $(this).attr('name', this.name + '_' + n);
                    });
              };
  </code></pre>
  
  <p>Am trying to append files twice to the form myForm. When i choose files second time, even after appending, i see that the previously appended input with id="attachment0" is not present in myForm and the input of id="attachment0_1" is present in the form. 
  Here am trying to upload multiple files multiple times, that is why am dynamically changing the id of the input in test().
  I want both input with id attachment0 and attachment0_1 in myForm.
  Does anyone know how this can be fixed? And explain this behavior too.</p>