티스토리 뷰

Web Programing Link/JQuery

jQuery empty() Method

발라키르카 2018. 4. 5. 19:16
반응형

jQuery empty() Method


==================


The empty() method removes all child nodes and content from the selected elements.

selector엘리먼트로부터 모든 child node들과 content를 지운다.


This method does not remove the element itself, or its attributes.

selector엘리먼트 그자체와 속성을 지우지는 못한다.


To remove the elements without removing data and events, use the detach() method.

data와 event들을 유지한채로 element들을 지우려면, detach() 메서드를 사용하라.


To remove the elements and its data and events, use the remove() method.

element들과 그것의 data, event들을 같이 지우려면, remove() 메서드를 사용하라.



=============

용법


$(selector).empty()





==========

ex>


$("button").click(function(){
    $("div").empty();
});


Remove the content of all <div> elements:

'Web Programing Link > JQuery' 카테고리의 다른 글

jQuery on() Method  (0) 2018.04.05
jquery change() method  (0) 2018.04.05
댓글
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
TAG
more
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함