<textarea cols='60' rows='8'>This is my statement one.\n This is my statement2</textarea>
<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.\n This is my statement2</textarea>
<textarea cols='60' rows='8'>This is my statement one.<br/> This is my statement2</textarea>
我尝试了两者,但是渲染html文件时新行没有反映出来。我怎样才能做到这一点?
您可能要使用\n
而不是/n
。
使用CSS在Textarea中输入Enter关键字行:
white-space: pre-wrap;
只需使用
<br>
ex:
结果:
blablablabla
kakakakakak
fafafafafaf