首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

,菜鸟的异常

2012-04-20 
求助,初学者的错误,!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org

求助,初学者的错误,
<!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>
</head>
<style type="text/CSS">
div.nifty{
width:500px;
height:30px;
border-radius:10px;
 margin: 2 10%;
 background-color:#CCCCFF;
}
div.Circle {
  width: 16px;
  height: 16px;
  background: red;
  border-radius: 8px;
border-style:inset outset outset inset;
margin-top:2px; 
}
</style>
<script type="text/javascript">
var x;
var Ismove = false ;
function ClickCircle()
{
if(!Ismove)
{
Ismove = true;
alert("Circle");
}
}
function ClickAxle(label)
{
  var tagCircle = document.getElementById(label);
alert("Axle1");
if(!Ismove)
{alert("Axle2");
Ismove = true;
}
alert("Axle4"); 
//tagCircle.style.margin-left = 30px;
alert(tagCircle.style.class);
}
</script>
<body>
<div id="Axle" onclick="ClickAxle('cir')" class="nifty">
<div id="cir" style="margin-left:20px" onClick="ClickCircle()" class="Circle"></div>
</div>
</body>
</html>


[解决办法]

JScript code
alert(tagCircle.className); 

热点排行