请问哪里错了
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
</head>
<body>
<div><b id="oldnode">JavaScript</b>是一个很常用的技术,为网页添加动态效果。</div>
<a href="javascript:replaceMessage()"> 将加粗改为斜体</a>
<script type="text/javascript">
function replaceMessage(){
if(document.getElementsByTagName("div").childNodes.nodeName=='b'){
var newnode = document.createElement("i");
var newnodeText = document.createTextNode("JavaScipt");
newnode.appendChild(newnodeText);
var oldNode = document.getElementById("oldnode");
oldNode.parentNode.replaceChild(newnode,oldNode);}
else{
var oldNode = document.createElement("b");
var oldNodeText = document.createTextNode("JavaScipt");
oldNode.appendChild(oldNodeText);
newnode.setAttribute("id","newnode");
var newnode = document.getElementById("newnode");
newnode.parentNode.replaceChild(oldNode,newnode);}
}
}
</script>
</body>
</html>