<div class="codetitle"> <span><a style="CURSOR: pointer" data="12626" class="copybut" id="copybut12626" onclick="doCopy('code12626')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code12626"> <br><html> <br><head> <br><title>无标题文档</title> <br><script type="text/javascript"> <br>function aa() <br>{ <br>s=form1.t1.value; <br>s=s.replace(//n|/r/g,"");// 加上g是全局替换,不加只替换第一个 是回车、是换行符 <br>form1.t1.value=s; <br>} <br></script> <br></head> <br><body> <br><form name="form1"> <br><textarea name="t1" style="height: 74px"></textarea> <br><input type="button" value="aa" onclick="aa()"> <br></form> <br></body> <br></html> <br> </div>