为什么在点修改p2的时候没有反应呢?
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>className属性</title>
<style type="text/css">
body{ font-size:20px;}
p.one{
border:1px solid #eee;
width:230px;
height:50px;
background:#ccc;
color:red;
}
p.two{
border:1px solid #ccc;
width:230px;
height:50px;
background:#9CF;
color:blue;
}
</style>
</head>
<body>
<p id="p1" class="two">123</p>
<input type="button" onclick="add()" value="xiugai p1">
<p id="p2" class="one">456</p>
<input type="button" onclick="add1()" value="xiugai p2">
<script type="text/javascript">
function add(){
var p1= document.getElementById("p1");
p1.className="one";
}
function add1(){
var p2=document.getElemnetById("p2");
p2.className="two";
}
</script>
</body>
</html>