Pages
Home
Java
Android
Php
Cake PHP
jQuery
Grails
All Pages
Sunday, June 23, 2013
jQuery textarea append newline behavior
You use the jQuery
val
method,
\n
works consistently in Firefox and IE (Including IE8):
var
txt
=
$
(
"textarea#idhere"
);
txt
.
val
(
txt
.
val
()
+
"\nSomething here\n\nAgain"
);
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment