为什么用setAttribute设置class属性不行?
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<style type="text/css">
.message{
width:200px;
height:100px;
background-color:#CCC;}
</style>
</head>
<body>
<script type="text/javascript">
var p = document.createElement("p");
p.setAttribute("class","message");
var text = document.createTextNode("I love javascript!");
p.appendChild(text);
document.body.appendChild(p);
</script>
</body>
</html>