title: Dynamic textboxes, Jquery
body: <pre><code>&lt;a href="#" id="AddMoreFileBox" class="btn btn-info"&gt;Add More Field&lt;/a&gt;
  &lt;div id="InputsWrapper"&gt;
  &lt;div&gt;&lt;input type="text" name="mytext[]" id="field_1" value="Text 1"&gt;&lt;a href="#" class="removeclass"&gt;&amp;times;&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Script:</p>
  
  <pre><code>&lt;script type='Javascript'&gt;
  $(document).ready(function() {
  
  var MaxInputs       = 8; //maximum input boxes allowed
  var InputsWrapper   = $("#InputsWrapper"); //Input boxes wrapper ID
  var AddButton       = $("#AddMoreFileBox"); //Add button ID
  
  var x = InputsWrapper.length; //initlal text box count
  var FieldCount=1; //to keep track of text box added
  
  $(AddButton).click(function (e)  //on add input button click
  {
          if(x &lt;= MaxInputs) //max input box allowed
          {
              FieldCount++; //text box added increment
              //add input box
              $(InputsWrapper).append('&lt;div&gt;&lt;input type="text" name="mytext[]" id="field_'+ FieldCount +'" value="Text '+ FieldCount +'"/&gt;&lt;a href="#" class="removeclass"&gt;&amp;times;&lt;/a&gt;&lt;/div&gt;');
              x++; //text box increment
          }
  return false;
  });
  
  $("body").on("click",".removeclass", function(e){ //user click on remove text
          if( x &gt; 1 ) {
                  $(this).parent('div').remove(); //remove text box
                  x--; //decrement textbox
          }
  return false;
  }) 
  
  });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>I found this on jfiddle. I tried it on my browser it won't add.</p>
  
  <p>Is there any declaration like loading of a the library?</p>
  
  <p><a href="http://jsfiddle.net/LYDuZ/" rel="nofollow">http://jsfiddle.net/LYDuZ/</a></p>