---
title: "JS删除特定DIV"
author: "berrywu"
date: "2010-04-01T11:43:17Z"
tags: []
categories: ["编程语言"]
slug: "js-div"
draft: false
lastmod: "2010-04-01T11:43:17Z"
id: 629844
url: "https://berrywu.iteye.com/blog/629844"
---

使用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>
```