这是易于使用的课程
<html>
<body>
<p>Not appended</p>
<style>
.append{
color:white;
background:black;
}
</style><script type='text/javascript'>
//create append
var node = document.createElement("p");
//set the text
node.innerHTML='Appended text';
//append it!
document.body.appendChild(node);
//add the class
node.className = 'append';
</script>
</body>
</html>