title: append text name to each input
body: <p>I try to add input dynamically. However each input I add is blank without a name. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() {
      var moreUploadTag = '';
      $('#attachMore').click(function() {
          moreUploadTag += '&lt;input type="text"/&gt;';
       jQuery(moreUploadTag).detach().appendTo("#boxed");
      });
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"&gt;&lt;/script&gt;
  
  
   &lt;div id="boxed"&gt;
    &lt;input type="text" name="" /&gt;
   &lt;/div&gt;
    &lt;p id="attachMore"&gt;attachMore&lt;/p&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>The purpose I left it blank without a name is I want to crate the name dynamically:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$('#addName').click(function(){
   //$('input').attr("name", $(this).attr("name") + "test");
   var named = $('input').val();  
   $('input').attr("name", $('input').attr("name") + named); 
  });
  
  $(document).ready(function() {
  
  
      $('#attachMore').click(function() {
          var moreUploadTag = '';
          moreUploadTag += '&lt;input type="text"/&gt;';
       jQuery(moreUploadTag).detach().appendTo("#boxed");
      });
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div id="boxed"&gt;
    &lt;input type="text" name="" /&gt;
   &lt;/div&gt;
    &lt;p id="attachMore"&gt;attachMore&lt;/p&gt;
  
    &lt;p id="addName"&gt;addName&lt;/p&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>However it adds name to all input. </p>
  
  <p>My question is how to add name input each of the inputs?</p>
  
  <p>Thanks in advance for the help. Cheers. </p>