When using textarea, there is a need to do a custom line, rather than through the textarea fixed width to automatically wrap, in fact, in the HTML can be directly through <br/> to line, but also think of \ n to achieve the line, the result is not bird you.
<cols= "$" rows= "5" ID= "Textareaid" >"Adfsadfs<br/>fddsadfds \ n dfadadf"</textarea >
Baidu a few online did say can use \ r \ n to achieve the line, if only compatible with Microsoft system directly \ n can, but the experiment does not, the back thought is not necessary through the JS assignment can be realized, so the following code appears:
<!DOCTYPE HTML><HTMLLang= "en"><Head> <MetaCharSet= "UTF-8"> <title>Document</title></Head><Body> <textareacols= " the"rows= "5"ID= "Textareaid">"Adfsadfs<BR/>Fddsadfds \ DFADADF "</textarea> <Scripttype= "Text/javascript">Document.onclick=function() {alert (1); varStr='5456455D4FGDFGDGDG \ Dsfafdadfadfafa'; document.getElementById ("Textareaid"). Value=str; } </Script> </Body></HTML>
Successful implementation of the textarea, so I infer that in order to achieve textarea, the dynamic JS must be assigned to the line.
Test address
Note: There are instructions on Baidu to achieve compatible Linux,unix,Mac OS, window, you can change \ r \ n, but I use \ n in the Apple system to achieve a line,Linux,unix The system does not test the personal feeling, solve
The individual knows limited, if has the wrong place also to be correct, the common study common progress!
TextArea Internal line break implementation