title: Trouble getting value of dynamically created textbox jquery
body: <p>I have  a webpage where the user inputs a number into a textbox and then that number of rows are created in a table with textboxes in each row with the id in the format of "id[I]" where I is the number assigned from the for loop used to add the textboxes. On form submit I'm trying to get the value of these textboxes. This is my form submit code to test things out.</p>
  
  <pre><code>$("#biopsyform").submit(function () {
      var site = $("#site[1]").attr("value");
      alert(site);
  });
  </code></pre>
  
  <p>when I submit the form I get an alert of <code>undefined</code> </p>
  
  <p>I've tried saying <code>var site = $("#site[1]#).val();</code> and get the same result.</p>
  
  <p>When using chrome developer tools in the javascript debugger when I break before the alert, it shows the correct value for <code>$("#site[1]")</code> so I'm not quite sure what is going on. </p>
  
  <p>Any help is greatly appreciated.</p>
  
  <p>Here is a <a href="http://jsfiddle.net/kPEAN/3/" rel="nofollow">jsfiddle</a> I'm getting an error in jsfiddle when I submit and I'm not sure why, I've never used jsfiddle. It could be part of my problem, it could be when I copied stuff over to jsfiddle, I don't know.</p>