Anrew,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
.div {
background: yellow;
width: 100px;
height: 100px;
float: left;
margin-right: 10px;
}
.top{
height: 150px;
border: 2px solid #191970;
padding: 10px;
margin: 50px;
}
</style>
<script>
window.addEventListener("DOMContentLoaded", function() {
var c = document.querySelectorAll(".delite"),
d = document.querySelectorAll(".alldelite");
[].forEach.call(c, function(a) {
a.addEventListener("click", function() {
var b = a.parentNode;
b.parentNode.removeChild(b)
})
});
[].forEach.call(d, function(a) {
a.addEventListener("click", function() {
var b = a.parentNode.querySelectorAll(".delite");
[].forEach.call(b, function(a) {
a.click()
})
})
})
});
</script>
</head>
<body>
<div class="top">
<div class="div">
<button type="button" class="delite" >удалить</button>
1</div>
<div class="div">
<button type="button" class="delite" >удалить</button>
2</div>
<div class="div">
<button type="button" class="delite" >удалить</button>
3</div>
<button type="button" class="alldelite">удалить все</button>
</div>
<div class="top">
<div class="div">
<button type="button" class="delite" >удалить</button>
1</div>
<div class="div">
<button type="button" class="delite" >удалить</button>
2</div>
<div class="div">
<button type="button" class="delite" >удалить</button>
3</div>
<button type="button" class="alldelite">удалить все</button>
</div>
<div class="top">
<div class="div">
<button type="button" class="delite" >удалить</button>
1</div>
<div class="div">
<button type="button" class="delite" >удалить</button>
2</div>
<div class="div">
<button type="button" class="delite" >удалить</button>
3</div>
<button type="button" class="alldelite">удалить все</button>
</div>
<div class="top">
<div class="div">
<button type="button" class="delite" >удалить</button>
1</div>
<div class="div">
<button type="button" class="delite" >удалить</button>
2</div>
<div class="div">
<button type="button" class="delite" >удалить</button>
3</div>
<button type="button" class="alldelite">удалить все</button>
</div>
</body>
</html>