如果要将斜体改为粗体
<!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>
<a href="javascript:bag()">将斜体改为粗体</a>
<script type="text/javascript">
var oldNode,newNode,a,c
function replaceMessage(){
newNode=document.createElement("i");
newnodeText=document.createTextNode("javascript");
newNode.appendChild(newnodeText);
oldNode=document.getElementById("oldnode");
oldNode.parentNode.replaceChild(newNode,oldNode);
}
function bag(){
a=document.createElement("b");
c=document.getElementById("newNode");
a.innerHTML=c.innerHTML;
c.parentNode.replaceChild(a,c);
}
</script>
</body>
</html>
我想将斜体再改回粗体,请大神看看哪里不对呢,为什么不行