title: Error using textarea generated in jquery and buttons
body: <p>I'm trying to make a site where I can reply some messages, the textarea is generated in jquery when a previous "reply" button is clicked. And then is shown a button to send the message (with Ajax), but right now I cannot get the value of the textarea, even trying with different ids, because each message has a number.</p>
  
  <pre><code>$(document).ready(function() {
  //Reply messages
      $(".reply-btn").click(function() { //Clicking reply button on message list          
          var class_reply = this.className.match(/btn_(\d+)/)[1];
  
          $( ".panel-body" ).prepend( '&lt;div class="main-reply-msg"&gt;&lt;/div&gt;' );
              $( ".main-reply-msg" ).append( '&lt;textarea class="message_replied" id="message_replied_'+class_reply+'" rows="10" cols="300" style="max-width: 100%;"&gt;&lt;/textarea&gt;' );
          $( ".main-reply-msg" ).append( '&lt;a href="#" class="btn btn-primary reply-msg-conv" style="width:100%;" role="button"&gt;Reply&lt;/a&gt;' );
          $( ".main-reply-msg" ).append( '&lt;hr&gt;' );
  
      $(".reply-msg-conv").click(function() { //Sending the reply
          message_replied_txt = $('.message_replied').val();
          console.log(message_replied_txt);
      });
     });
  });
  </code></pre>
  
  <p>That is the code, which I'm trying to make it work, the second click works, but the textarea.val() is empty. I also tried putting the second click() outside the first, but then that click() doesn't work.</p>
  
  <p>Anyone have had this problem before, because I've tried many things and nothing works.</p>
  
  <p><strong><em>Update to make it more understandable:</em></strong></p>
  
  <ul>
  <li>The value of class_reply works fine. tested</li>
  <li>This function is inside onready() function.</li>
  </ul>
  
  <p>The function works as follows: </p>
  
  <ol>
  <li>List of different messages, which
  are loaded from jquery (even the html code). </li>
  <li>When click on a message is shown the full message preview and a button to reply. </li>
  <li>When you click on the button is loaded this function. </li>
  <li>The function is loaded (the textarea and low button is shown), but when you click in the new button generated the values of the inputs (textarea and
  input fields) are not displayed any value.</li>
  </ol>