js替换换行
这是把Textarea里的换行全部替换为空格的代码.
代码
$(document).ready(function () {
$("textarea").blur(function () {
var o = $(this).text();
var p = o.replace(/\r/ig,",").replace(/\n/ig,",");
$(this).text(p);
});
});
$("textarea").blur(function () {
var o = $(this).text();
var p = o.replace(/\r/ig,",").replace(/\n/ig,",");
$(this).text(p);
});
});