This topic created in 4845 days ago, the information mentioned may be changed or developed.
我有个 div contenteditable ,监听paste 事件 ,把取得的粘贴内容 ,用jquery text() 方法 添加进去,但是会发现原内容的所有空格和换行符都被扔掉了,我想保留空格和换行符,请问该如何做?
本来用 html() 也可以,但是如果我的内容是html 代码块,就不行了。
1 replies • 1970-01-01 08:00:00 +08:00
 |
|
1
qiayue Jan 30, 2013
字符串替换,\r\n转成<br />
|