向通过 .text() 填充的文本区域添加换行符
我有一个向表添加行的方法。其中一个单元格是一个textarea
;我添加了一个脚本来添加换行符。但是,当添加它时,它实际上会写入
文本。
我认为这是因为我使用 .text()
调用值。
我尝试使用 replaceWith()
替换写入的
,但这也不起作用。
I have a from that adds rows to a table. One of the cells is a textarea
; I have added a script to add line breaks to this. However when it is added it actually writes the <br>
text.
I think this is because I am calling the values using .text()
.
I tried to replace the written <br>
using replaceWith()
but that didn't work either.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用 .html() 而不是 .text()。
Try using .html() instead of .text().