This is my statement one.\n This is my statement2
<textarea cols='60' rows='8'>This is my statement one.<br/> This is my statement2</textarea>
我尝试了两者,但是渲染html文件时新行没有反映出来。我怎样才能做到这一点?
试试这个:
<textarea cols='60' rows='8'>This is my statement one. This is my statement2</textarea>
换行符和 回车符是HTML实体Wikipedia。这样,您实际上是在分析新行(“\ n”),而不是将其显示为文本。