当前位置:编程学习 > JS >>

请大家帮帮忙看看我的javascript哪里出错了,我是菜鸟~~希望各位大侠指教

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档</title> <style type="text/css"> p,ul, ul li{ margin:0; border:0; padding:0; list-style:none} .box{ width:200px;} .box p{ width:200px; background:#CCCCCC; height:20px; line-height:20px; cursor:pointer} .box ul li,.box ul{line-height:20px;} </style> <script type="text/javascript"> window.onload=function () { var oBtn=document.getElementById('btn'); var oUll=document.getElementById('ull'); oBtn.onclick=function() { if(oUll.style.display=='block') { oUll.style.display=='none'; } else { oUll.style.display=='block'; } } } </script> </head> <body> <div class="box"> <p id="btn">输入法</p> <ul id="ull" style="display:block;" > <li>数字输入法</li> <li>五笔输入法</li> <li>全屏输入法</li> </ul> </div> </body> </html>
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,