<html>
<script language="javascript">
function a(){
var r, re;
re = /[\r\n]+/mg;
r =document.getElementById('a').value.replace(re, "|");
alert(r);
}
</script>
<body>
<textarea id="a" rows=5>
</textarea>
<input type="button" value="test" onclick="a();">
</body>
</html>
posted on 2008-01-18 20:10
Crying 阅读(1110)
评论(1) 编辑 收藏 所属分类:
JavaScript和CSS