Reputation: 7345
$('.quote').live('click', function() {
var quote = "test";
$("#msg").append(quote).scrollTop($('#msg')[0].scrollHeight).focus();
});
This function just copies "test" to the textbox. Since it will be a multi-quote function I used the append() function. It works fine. Even when I focus on the textbox.
BUT when I type any characters in the textbox or break the line it no longer works. Any ideas?
msg - textbox
focus(); isn't also working for some reason.
Upvotes: 0
Views: 75
Reputation: 10315
try:
$("#msg").val(function(index, value) {
return value + ' ' + quote;
}).scrollTop($('#msg')[0].scrollHeight).focus();
Upvotes: 2