日期:2014-05-16 浏览次数:20375 次
window.onload=function(){ var s = document.forms[0].txt.value; s = s.replace(/<br>/ig, "\n"); document.forms[0].txt.value = s; }
------解决方案--------------------
放到<script>中间
<script> window.onload=function(){ var s = document.forms[0].content.value; s = s.replace(/<br>/ig, "\n"); document.forms[0].content.value = s; } </script>
------解决方案--------------------
function runEx(cod1) {
cod=document.all(cod1)
var code=cod.value.replace(/<br\s*\/?>/g,"\n")
------解决方案--------------------
<script> window.onload=function(){ var s = document.getElementById("textareaId").value; document.getElementById("textareaId").value = s.replace(/<br\s*\/?\s*>/g, "\n"); } </script>
------解决方案--------------------
<html> <head> <script> window.onload=function(){ var obj=document.getElementById("code"); obj.value=obj.value.replace(/<br>/gim,"\r\n"); } </script> <textarea rows='12' cols='78' class='fm' id='code' name="content"> abc<br>bcd </textarea>