日期:2014-05-19  浏览次数:20465 次

google suggest 的问题: 输入提醒后, span为什么隐藏不了呢
代码两部分:
第一部分,页面:
<html   xmlns= "http://www.w3.org/1999/xhtml "   >
<head   runat= "server ">
        <title> Untitled   Page </title>

        <link   href= "style.css "   rel= "stylesheet "   type= "text/css "   />

<script   src= "build.js "   type= "text/javascript "   language= "javascript "> </script>
</head>

</head>
<body   onResize= "ReDraw() ">       <!—定义网页窗口大小发生变化的时候调用ReDraw()函数   -->
<div   align= "center ">
        <form   id= "Form1 "   AUTOCOMPLETE= "off "     runat= "server ">     <!—定义表单   -->
AutoComplete   Text   Box:   <input   type= "text "   name= "txtUserInput "/>       <!—定义文本输入框   -->
<input   type= "hidden "   name= "txtUserValue "   ID= "hidden1 "   />       <!—定义隐藏域   -->
<input   type= "text "   name= "txtIgnore "   style= "display:none "   />       <!—定义辅助的文本输入框   -->
</form>
</div>
</body>
</html>


------解决方案--------------------
document.getElementById( "spanOutput ").style.display = "none ";
改成
document.getElementById( "spanOutput ").innerHTML = " ";