<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title></title>
<script src="../jquery-1.10.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$(".aa").on('click', function(){
$(".aa").empty();//删除aa下的所有元素
})
});
</script>
<style>
.aa{
width:150px;
height:150px;
margin:10px;
background-color:red;
}
.bb{
width:150px;
height:150px;
margin:10px;
background-color:green;
}
</style>
</head>
<body>
<div class="aa">
<span>大姑娘</span>
<span>小姑娘</span>
</div>
</body>
</html>
点击前
点击后