大神帮忙看一下为什么f_oldnode找不到
<!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(){
var f_oldnode=document.getElementsByTagName("div");
//document.write(f_oldnode.innerHTML);
var oldnode=f_oldnode.firstChild;
var oldHTML=oldnode.innerHTML;
//document.write(oldHTML);
var newnode=document.createElement("i");
f_oldnode.replaceChild(newnode,oldnode)
newnode.innerHTML=oldHTML;
}
</script>
</body>
</html>