<html>
<body>
<script language=javascript>
function test()
{
var txt = document.getElementById("txt1");
txt.style.display="none";
window.status = txt.value;
}
</script>
<textarea id="txt1" name="txt1" onblur="test()"></textarea>
<br>
<input type=button value="button" onmousedown="alert('click button');">
</body>
</html>

解决方案 »

  1.   

    <input type=button value="button" onmousedown="alert(txt1.value);">
      

  2.   

    <html>
    <body>
    <script language=javascript>
    function test()
    {
    var txt = document.getElementById("txt1");
    txt.style.display="none";
    window.status = txt.value;
    window.event.cancelBubble = true;
    window.event.returnValue = false;
    }
    </script>
    <textarea id="txt1" name="txt1" onblur="test()"></textarea>
    <br>
    <input type=button value="button" onclick="alert('click button');">
    </body>
    </html>
      

  3.   

    txt.style.display="none";==>txt.style.visibility = "hidden"