<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> <br> <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> <br> <br><form name="form1"> <br><textarea name="t1" style="height: 74px"></textarea> <br><input type="button" value="aa" onclick="aa()"> <br> </form> <br> <br> <br> </div>