<html>
<script>
window.onload=function(){
var obj = document.getElementsByName("title")[0];
obj.onblur = function(){
document.getElementById("showtext").innerHTML = obj.value;
}
}
</script>
<body>
<input name="title" id="title" type="text"> 
<div id="showtext"> </div>
</body>
</html>

解决方案 »

  1.   


    <html>
    <script>
    window.onload=function(){
    var obj = document.getElementsByName("title")[0];
    obj.onblur = function(){
    document.getElementById("showtext").innerHTML = obj.value;
    }
    }
    </script>
    <body>
    <input name="title" id="title" type="text"> 
    <div id="showtext"> </div>
    </body>
    </html>
      

  2.   

    <html>
    <script>
    window.onload=function(){
    var obj = document.getElementsByName("title")[0];
    obj.onblur = function(){
    document.getElementById("showtext").innerHTML = obj.value;
    }
    }
    </script>
    <body>
    <input name="title" id="title" type="text"> 
    <div id="showtext"> </div>
    </body>
    </html>