日期:2014-05-18  浏览次数:21064 次

怎么在<textarea>中显示文字??应该比较简单
像下面的代码是两个框,我在左边输入一些东西,点击按钮,在左边的东西就在右边的textarea中显示出来,而且要左边的textarea中的文字不消失,怎么办???
 
      <form   action= "editpage.jsp "   method= "post "   name= "form1 ">
       
        <textarea   rows= "15 "   cols= "33 "   name= "textedit "   wrap= "hard "> </textarea>
       
        <input   type= "submit "   name= "submit "   value= "复制 "   title= "submit ">

        <textarea   rows= "15 "   cols= "33 "   wrap= "hard "   name= "textedit2 "> </textarea>
        </form>

------解决方案--------------------
document.form1.textedit2.value = document.form1.textedit.value
------解决方案--------------------
<form action= "editpage.jsp " method= "post " name= "form1 ">

<textarea rows= "15 " cols= "33 " name= "textedit " wrap= "hard "> </textarea>

<input type= "button " name= "button " value= "复制 " title= "submit " onclick= "mk_confirm() ">

<textarea rows= "15 " cols= "33 " wrap= "hard " name= "textedit2 "> </textarea>
</form>
<script>
function mk_confirm()
{
var textedit = document.getElementById( "textedit ").value;
var textedit2= document.getElementById( "textedit2 ");
textedit2.value = textedit;
}
</script>