我正在使用String.fromCharCode
将新行(或)回车添加到我的html文本中。使用fromCharCode的HTML换行符不起作用
很是喜欢,
"Ant the other line here..." + String.fromCharCode(13)
的jsfiddle是@http://jsfiddle.net/udmfsvfn/
但是,没有换行符在页面中加入!
我正在使用String.fromCharCode
将新行(或)回车添加到我的html文本中。使用fromCharCode的HTML换行符不起作用
很是喜欢,
"Ant the other line here..." + String.fromCharCode(13)
的jsfiddle是@http://jsfiddle.net/udmfsvfn/
但是,没有换行符在页面中加入!
如果您想在HTML中换行,您需要提供<br>
实体而不是换行符(您的String.fromCharCode(13)
代码),因为HTML将文本中的换行符解释为常用空格。