请大家帮帮忙看看我的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>

你多了几个等于符号,改下就行了
if(oUll.style.display=='block')
{
oUll.style.display='none';//这里
}
else
{
oUll.style.display='block';//这里
}
温馨提示:答案为网友推荐,仅供参考
相似回答