title: Turning dynamically created texboxes' values into JSON data
body: <p>I am trying to create an application that will allow users to add a textbox and then submit the data in the textbox to a JSON file. I have tried using Ajax, but am unsure how it works with dynamically created objects. Any help in any language would be appreciated. </p>
  
  <p>Here is the code to create the textbox: </p>
  
  <pre><code>    $(document).ready(function(){
                   var counter = 2;
                   $("#addButton").click(function () {
                  if(counter&gt;1000000){
                          alert("Exceeded Text Box Limit");
                          return false;
                  }   
                  var newTextBoxDiv = $(document.createElement('div'))
                       .attr("id", 'TextBoxDiv' + counter);
                  newTextBoxDiv.after().html(
                        '&lt;input type="text" class="title" name="title[]' + counter + 
                        '" id="title' + counter + '" value="" &gt;');
  
   );   
                  newTextBoxDiv.appendTo("#Spacer");
                  counter++;
   });
  </code></pre>
  
  <p>Also, is it possible to remove this data if the user removes a text box? Thanks in advance.</p>