为什么这个代码删除不了这个h1的节点内容?求各位大神指教
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
</head>
<body>
<div id="content">
<h1>html</h1>
<h1>php</h1>
<h1>javascript</h1>
<h1>jquery</h1>
<h1>java</h1>
</div>
<script type="text/javascript">
function clearText()
{
// var content=document.getElementById("content");
var hs=document.getElementsByTagName("h1");
for(var i=0;i<hs.length;i++)
{
var a=hs.childNodes[i];
var b=hs.removeChild(a);
document.write("删除h1节点的内容为"+b[i].innerHTML);
}
}
</script>
<button onclick="clearText()">清除节点内容</button>
</body>
</html>