I have a problem with append() working in IE but not in FF. I append text to a content in text area. if I load textarea with text and then delete a few chars, and then try to append -- it does not work. Is there an alternative to it?
-
2How is it that you have asked 74 questions, and still don't know that with no code, you might as well not ask at all?davin– davin2011-03-04 14:36:42 +00:00Commented Mar 4, 2011 at 14:36
-
You are probably doing something wrong.... though my powers are not string (strong :P :D) enough to predict what. Could you post your code to make it easier for us?Felix Kling– Felix Kling2011-03-04 14:37:41 +00:00Commented Mar 4, 2011 at 14:37
-
@Felix, "my powers are not string enough", nice unintentional pun :)davin– davin2011-03-04 14:38:42 +00:00Commented Mar 4, 2011 at 14:38
-
I think its awesome I wouldn't correct it.Loktar– Loktar2011-03-04 14:40:25 +00:00Commented Mar 4, 2011 at 14:40
-
@davin: That could be a nice programmer slogan: Are you really string enough to do...? or How string are you?Felix Kling– Felix Kling2011-03-04 14:40:54 +00:00Commented Mar 4, 2011 at 14:40
|
Show 2 more comments
1 Answer
If you're working with a textarea, you should be using .val() to set its value instead of .append().
$('textarea').val( function( i, val ) { return val + "new text"; } );
3 Comments
Felix Kling
@ElGuapo: Patrick is one of our Masters. It is difficult to trick him. May the Force be with you both!
santa
Normally I post the code. In this case I checked my code many times and was looking for an insight of this caliber. The problem is not my code but the wrong choice of code for TEXTAREA. Thanks @patrick dw!
user113716
@Felix, @ElGuapo: You're far too kind. :o)