======jQuery - Remove Elements====== * description : jQuery - Remove Elements * author : 오션 * email : shlim@repia.com * lastupdate : 2021-04-16 \\ %%jQuery%%를 사용하면 현재 사용되는 %%HTML%% 요소들을 쉽게 제거할 수 있습니다.\\ =====Remove Elements/Content===== 요소들과 콘텐츠를 제거하기 위한 두 가지의 주된 %%jQuery%% 메서드가 있습니다.\\ * ''remove()'' - 선택한 요소 (및 자식 요소)를 제거합니다. * ''empty()'' - 선택한 요소에서 자식 요소를 제거합니다. =====jQuery remove() Method===== %%jQuery%% ''remove()'' 메소드는 선택된 요소와 그 자식 요소를 제거합니다.\\ ====예제==== $(document).ready(function () { $("button").click(function () { $("#div1").remove(); }); }); =====jQuery empty() Method===== %%jQuery%% ''empty()'' 메서드는 선택한 요소의 자식 요소를 제거합니다.\\ ====예제==== $(document).ready(function () { $("button").click(function () { $("#div1").empty(); }); }); =====Filter the Elements to be Removed===== %%jQuery%% ''remove()'' 메서드는 또한 하나의 매개변수를 받아서, 제거할 요소를 필터링 할 수 있게 합니다.\\ \\ 매개 변수는 %%jQuery%% 셀렉터 구문 중 하나 일 수 있습니다.\\ \\ 다음 예제는 ''%%class="test"%%''를 가진 모든 ''%%

%%'' 요소를 제거합니다:\\ ====예제==== $(document).ready(function () { $("button").click(function () { $("#div1").empty(); }); }); \\ 다음 예제에서는 ''%%class="test"%%''및 ''%%class="demo"%%''가 있는 모든 ''%%

%%'' 요소를 제거합니다:\\ ====예제==== $(document).ready(function () { $("button").click(function () { $("p").remove(".test, .demo"); }); }); =====jQuery HTML Reference===== 모든 %%jQuery%% %%HTML%% 메서드에 대한 전체 개요를 보려면, [[https://www.w3schools.com/jquery/jquery_ref_html.asp|jQuery HTML/CSS Reference]]로 이동하십시오. {{tag>오션 jQuery - Remove Elements}}