replaceChild()
<script type="text/javascript">
function replaceMessage(){
var newnode=document.createElement("i");
var newnodeText=document.createTextNode("JavaScript");
newnode.appendChild(newnodeText);
var oldNode=document.getElementById("oldnode");
oldNode.parantNode.replaceChild(newnode,oldNode);
}
</script>
请问这段代码有什么问题?为什么执行后没有改为斜体呢?