코딩_jquery
jquery - detach() : 줄 삭제(버퍼에 남음?)
잠수콩
2011. 3. 25. 13:27
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<button id="T">Click</button>
<button id="B">AClick</button>
<div class="container">
<div class="hello">Hello</div>
<div class="goodbye">Goodbye</div>
</div>
<script>
$(document).ready(function() {
$('#T').click(function () {
//$('.hello').remove();
//$('div').remove('.hello'); // 위의 소스와 동일한 소스
$('div').detach('.hello');
});
});
</script>
</body>
</html>