1
在此代码删除对象的jQuery 1.5工作正常,但不使用jQuery 1.6工作:删除不克隆的对象工作
<!DOCTYPE html>
<html>
<head>
<style>.content {border: 1px solid #333;} .delete {color: red;}</style>
<script src="http://code.jquery.com/jquery-1.5.js"></script>
</head>
<body>
<div id="master">
<div class="content">Some content <span class="delete">Delete</span></div>
</div>
<div class="clone">Clone</div>
<script>
$(".clone").click(function() {
$("#master").find(".content").last().clone().appendTo("#master");
});
$(".delete").click(function() {
$(this).parents(".content").remove();
});
</script>
</body>
</html>
与jQuery 1.6 +我可以只删除第一个元素。为什么它不起作用?