jQueryで親を殺す方法、子を殺す方法、そして生かす方法1
by iwbjp
HTML
<div class="p">
parent1
<div class="c">child1</div>
</div>
<div class="p">
parent2
<div class="c">child2</div>
</div>
CSS
.p,
.c {
float: left;
margin-right: 10px;
padding: 20px;
border: 1px solid #CCC;
text-align: center;
}
.c {
width: 50px;
background: #EEE;
cursor: pointer;
}
JavaScript
$(".c").click(function(){;
$(this).remove();
});