日期:2014-05-16  浏览次数:20361 次

求助,初学者的错误,
<!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);