<style type="text/css">
input{
font-size:10px;
}
.one{
width:200px;
}
.two{
font-size:18px;
color:#F00;
}
</style>
</head>
<body>
<p id="con" class="one">JavaScript</p>
<form>
<input type="button" value="点击更改" onclick="modifyclass()">
</form>
<script type="text/javascript">
var mychar=document.getElementById("con");
document.write("p元素Class值为:" + mychar.className+"</br>")
function modifyclass(){
mychar.className="two";
document.mychar.innerHTML("p元素Class值为:two");
}
</script>
document.mychar.innerHTML("p元素Class值为:two");改成 mychar.innerHTML="p元素Class值为:two";