<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
#div1{width: 100px; height: 100px; background-color: red;}
#div2{width: 200px; height: 200px; border: 1px solid black;}
</style>
<script src = 'jquery-1.10.1.min.js'></script>
<script>
$(function(){
$("#div1").click(function(){
alert(this.id);
}).mouseover(function(){
$(this).css("backgroundColor", 'yellow');
}).mouseout(function(){
$(this).css("backgroundColor", 'blue');
})
$("button").click(function(){
var node = $("#div1").detach();
node.appendTo("#div2");
})
})
</script>
</head>
<body>
<div id = 'div1' title = 'hello' class = 'box' name = 'world'></div>
<button>删除节点</button>
<div id = 'div2'></div>
</body>
</html>