jQuery之remove与empty的区别
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>empty_remove</title>
<meta charset="UTF-8">
<script src="jquery-2.1.4.min.js"></script>
</head>
<body>
<h1>hello</h1>
<div>hello div2<P>hellop</P></div>
<script>
// $('div').remove();//remove()----将标签和文本全部删除
$('div').empty();//只将文本删除,而将标签留下
</script>
</body>
</html>