87,955
社区成员
![](https://csdnimg.cn/release/cmsfe/public/img/topic.427195d5.png)
![](https://csdnimg.cn/release/cmsfe/public/img/me.40a70ab0.png)
![](https://csdnimg.cn/release/cmsfe/public/img/task.87b52881.png)
![](https://csdnimg.cn/release/cmsfe/public/img/share-circle.3e0b7822.png)
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title> 页面名称 </title>
<style type="text/css">
#div1,#div2 {
float: left;
width: 200px;
height: 300px;
border: 1px solid red;
}
</style>
<script type="text/javascript" src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
</head>
<body>
<div id="div1">
<div>001</div>
<div>002</div>
<div>003</div>
<div>004</div>
<div>005</div>
</div>
<div id="div2"></div>
<script type="text/javascript">
$("#div1").on("click", "div", function(event){
$(this).appendTo("#div2");
$("#div1").append('<div>006</div>');
})
$("#div2").on("click", "div", function(event){
$(this).appendTo("#div1");
})
</script>
</body>
</html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title> 页面名称 </title>
<style type="text/css">
#div1,#div2 {
float: left;
width: 200px;
height: 300px;
border: 1px solid red;
}
</style>
<script type="text/javascript" src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
</head>
<body>
<div id="div1">
<div class="as">001</div>
<div class="as">002</div>
<div class="as">003</div>
<div class="as">004</div>
<div class="as">005</div>
</div>
<div id="div2"></div>
<script type="text/javascript">
$("#div1").on("click", "div.as", function(event){
$(this).appendTo("#div2");
$("#div1").append('<div>006</div>');
})
$("#div2").on("click", "div.as", function(event){
$(this).appendTo("#div1");
})
</script>
</body>
</html>