ITeye博客

JS删除特定DIV

berrywu · 2010-04-01 11:43 · JavaScript技术 · 编程语言 · Markdown

使用removeChild来移除元素

<html>
<body>
<div id="d" style="color:red;">112</div>
<body>
<script>
var obj = document.getElementById("d");
document.body.removeChild(obj);
</script>
</html>

 

 

顺便说一下,若想隐藏DIV

<div di='qq'>adsf</div>
<scrtip>
      document.all.qq.style.display='none';
</script>

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。