<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");
for(i=0;i<content.length;i++)
{content.removeChild(content[i]);
}
}
</script>
<button onclick="clearText()">清除节点内容</button>
qq_青枣工作室_0
相关分类