本代码实现了运用点击按钮调用Script时间来实现div的显示与隐藏,具体代码如下:
<script type="text/javascript"> function show() { var ele=document.getElementById("click"); ele.style.visibility="visible"; }
function hide() { var ele=document.getElementById("click"); ele.style.visibility="hidden"; } </script> <body> <input type="button" value="显示" onclick="show()"> <input type="button" value="隐藏" onclick="hide()"><br> <div id="click">人文奥运 绿色奥运 和谐奥运</div> </body>
|
阅读(757) | 评论(0) | 转发(0) |