jooner888 / textarea_add_p

文本域回车添加 p标签

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

textarea_add_p

文本域回车 自动添加<p>***</p>标签

函数

<script>
//用<p>***</p>标签替换回车
function ReplaceSeperator(html) {
var i;
var result = "<p>";
var c;
for (i = 0; i < html.length; i++) {
c = html.substr(i, 1);
if (c == "\n")
result = result + "</p><p>";
else if (c != "\r")
result = result + c;
}
return result;
}
</script>

About

文本域回车添加 p标签


Languages

Language:HTML 100.0%