各位大佬,為什么我的運行不出來呀
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>無標(biāo)題文檔</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");
? // 在此完成該函數(shù)
? var node=content.childNodes[i];
? for(var i=0;i<node.length;i++){
????? content.removeChild(node);
? }
}
</script>
<button onclick="clearText()">清除節(jié)點內(nèi)容</button>
</body>
</html>
2021-03-01
這個應(yīng)該放在for循環(huán)里面