且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

文本区域中的新行

更新时间:2023-02-23 15:20:31

试试这个:

Try this one:

<textarea cols='60' rows='8'>This is my statement one.&#13;&#10;This is my statement2</textarea>

&#10; 换行和&#13; 回车是 HTML实体 wikipedia 。这样你实际上是在解析新行(\\\
)而不是将它显示为文本。

&#10; Line Feed and &#13; Carriage Return are HTML entitieswikipedia. This way you are actually parsing the new line ("\n") rather than displaying it as text.