想实现如题的这个功能:
一个页面有两个文本框A、B,在B中填入‘大家好’,A中能即时显示出来,请问用js怎么实现

解决方案 »

  1.   


    <input id="a" />
    <input id="b" />
    <script>
    function $(o){return document.getElementById(o)}
    $('a').onkeyup = function(){
    $('b').value = this.value;
    }
    </script>楼主 这个意思?
      

  2.   


    <input onpropertychange="document.getElementById('m').value=this.value"/><br/>
    <input id="m"/>
      

  3.   

    <html>
    <head>
    <title></title>
    <script type="text/javascript">function showValInA(obj){
        document.getElementById('a').value = obj.value
    }
       
    </script>
    </head>
    <body>
    我是A:<input type="text" id="a"></br>
    我是B: <input type="text" id="b" onkeyup="showValInA(this)">
    </body>
    </html>
      

  4.   

     <input type="text" id="A"   />  
     <input type="text" id="B" onpropertychange="testOninput(this)" oninput="testOninput(this)"/>  
      function testOninput(obj){
    document.getelementById("A").value=obj.value;
    }
      

  5.   


    显示<input type="text" id="a"></br>
    输入<input type="text" id="b" onkeyup="document.getElementById('a').value=this.value">