Element.hide('text');或者 $('text').hide();

解决方案 »

  1.   

    <html>
    <head>
    <title>hidetext</title>
    <script src="scripts/prototype.js"></script>
    </head>
    <body>
    <form   id= "form1 "   name= "form1 "   method= "post " action= " "> 
    <input   type= "text" id="text" name="text"> 
    <input   type= "button" id="go" value="go" onclick="hidetext();"> 
    </form> 
    <script>
    function hidetext() {
    Event.observe($('go'), 'click', function(event) {
    Element.hide('text');
    }); 
    }
    </script>
    </body>
    </html>这样可以