如何获取最新更新的文本区域输入值并对该值进行 html 编码。
要获取我使用的值:
$('textarea').val(); // this works cross browser
但是如果值为 "sdfgsdgdsgsdg <br/>"
我如何对其进行 HTML 编码?
当我stringify()
时它就坏了它
var e = { "d" : $('textarea').val()};
var s = JSON.stringify(e); //it breaks here
最佳答案
关于javascript - html 编码 <textarea> 值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11901455/