<!--通过createElement(),createTextNode),appendChild()方法来显示文字-->
<html>
<head>
<title>createElement() Example</title>
<script type="text/javascript" language="javascript">
function createMessage(){
var oP=document.createElement("p");
var oText=document.createTextNode("Hello World!");
oP.appendChild(oText);
document.body.appendChild(oP);
}
</script>
</head>
<body bgcolor="#CCFFFF" οnlοad="createMessage()">
</body>
</html>