Add text to textarea - Jquery

Oliver 'Oli' Jensen picture Oliver 'Oli' Jensen · Aug 14, 2011 · Viewed 106k times · Source

How can I add text from a DIV to a textarea?

I have this now:

    $('.oquote').click(function() { 
      $('#replyBox').slideDown('slow', function() {
      var quote = $('.container').text();   
         $('#replyBox').val($('#replyBox').val()+quote);   
        // Animation complete.
      });    
    });

Answer

AlienWebguy picture AlienWebguy · Aug 14, 2011

Just append() the text nodes:

$('#replyBox').append(quote); 

http://jsfiddle.net/nQErc/