点击按钮后,div的背景颜色也消失了,为什么?
<head>
<meta charset="utf-8">
<script src="http://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.min.js"></script>
<style type="text/css">
.t1{
background: red;
}
</style>
<title></title>
</head>
<body>
<div class="t1">
<p>text1</p>
<p>text2</p>
</div>
<button>使用empty删除</button>
<script type="text/javascript">
$("button").on('click',function(){
$(".t1").empty();
})
</script>
</body>