您现在的位置是:首页 > 电脑技术查询 > web开发

javascript 查找有关问题 多谢啦

编辑:chaxungu时间:2022-10-02 23:14:27分类:web开发

javascript 查找问题 谢谢啦 急
<HTML>
<HEAD>
<script>
window.onload = function()
{
var dc = document.getElementById("one");

dc.onclick = function()
{
bigorsmall(dc);
};
};

function bigorsmall(a)
{
if(a.className == "small")
{
a.className = "big";
}
else
{
a.className = "small";
}
}

</script>

<style type="text/css">
.big{height:200px;width:200px;background:blue;}
.samll{height:150px;width:150px;background:red;}
</style>
</HEAD>

<BODY>
<div id = "one" class="big"></div>
</BODY>
</HTML>
-----------------------------------
代码的目的是点击 div 区域 变大变小 这段代码 哪里有错误 谢谢了

------解决方案--------------------
.samll{height:150px;width:150px;background:red;}
small拼错了