Pages
(Move to ...)
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
‹
›
Home
View web version
No comments:
Post a Comment