title: Button to update the text in a field
body: <p>So I have some things working with an input field and a button that adds a new copy of the field. Next I want to update the initial input field with a new question on the click.</p>
  
  <p>HTML: </p>
  
  <pre><code>&lt;input type="text" name="input" id="input" size="30" value="What is your name?"&gt;
  &lt;a href="#" id="addScnt"&gt;Enter&lt;/a&gt;
  
  &lt;div id="namess"&gt;
  &lt;div&gt;
      &lt;label for="names"&gt;&lt;/label&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>JQUERY:</p>
  
  <pre><code>var $input = $("#input");
  
  $(function () {
  var scntDiv = $('#namess');
  var i = $('#namess p').size() + 1;
  
  $('#addScnt').live('click', function () {
      $('&lt;p&gt;&lt;label for="names"&gt;&lt;input type="text" name="names_' + i + '" id="name" size="30" value="' + $input.val() + '"&gt;&lt;/label&gt;&lt;a href="#" id="remScnt"&gt;  Remove&lt;/a&gt;&lt;/p&gt;').appendTo(scntDiv);
      i++;
      return false;
  });
  
  $('#remScnt').live('click', function () {
      if (i &gt; 1) {
          $(this).parents('p').remove();
          i--;
      }
      return false;
  });
  });
  </code></pre>
  
  <p>Here's my fiddle: <a href="http://jsfiddle.net/miketrujillo/nV2tA/" rel="nofollow">http://jsfiddle.net/miketrujillo/nV2tA/</a></p>
  
  <p>I'm afraid I'll have to come up with a whole new approach to get this to work.. json and array?</p>