为什么我这段代码运行不出来??
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
</head>
<body>
<h1 id="oldnode">java</h1>
<a href="javacript:replaceMessage()">java替换javascript</a>
<script>
function replaceMessage(){
var oldNode=document.getElementById("oldnode");//获取oldnode节点
var newNode=document.createElement("p");//新建newNode节点
//var newNodeText=document.createTextNode("javascript");//创建文本节点
//newNode.appendChild(newNodeText);//将文本节点插入到newnode中
newNode.innerHTML="javescript";
oldNode.parentNode.replaceChild(newNode,oldNode);//新节点代替旧节点
}
</script>
</body>
</html>