一个界面中有两个文本域,当填写第一个文本域,第二个文本域会自动与第一个文本域值统一
// 第一个文本域
<textarea name="a" id="deploy_reason_desc" rows="6" cols="60" style="width:85%"></textarea>//第二个文本域<textarea name="b" id="deploy_summary" rows="4" cols="60" style="width:85%" value=""></textarea>

解决方案 »

  1.   

    JS:
    document.getElementById("deploy_reason_desc").value=document.getElementById("deploy_summary").value;
      

  2.   

    document.forms[0].a.value;
    document.forms[0].b.value;
      

  3.   

    document.getElementById('deploy_summary').innerText = document.getElementById('deploy_reason_desc').innerText;
      

  4.   

    你好,楼主!
    不确定是哪种,但都可以试试,基本上就是这两种方法啦1、document.getElementById(deploy_reason_desc').innerText = document.getElementById(deploy_summary').innerText2、document.getElementById("deploy_reason_desc").value=document.getElementById("deploy_summary").value;
      

  5.   

    <textarea name="a" id="deploy_reason_desc" rows="6" cols="60" style="width:85%" onKeyUp="test()"></textarea>function test(){
    document.getElementById("deploy_summary").value=document.getElementById("deploy_reason_desc").value;
    }
      

  6.   


    / 第一个文本域
    <textarea name="a" id="deploy_reason_desc" rows="6" cols="60" style="width:85%" onchange="change()"></textarea>
    function change(){
    document.getElementById("deploy_reason_desc").value=document.getElementById("deploy_summary").value;
    }
      

  7.   

    文本框.onchange=function(){
    document.getElementById("deploy_reason_desc").value=document.getElementById("deploy_summary").value;}