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.
});
});
That should work. Better if you pass a function to
val
:This way you avoid searching the element and calling
val
twice.Just
append()
the text nodes:http://jsfiddle.net/nQErc/