jQuery undelegate() 메서드
예시
모든 요소에서 delegate() 메서드로 추가된 모든 이벤트 핸들러를 제거합니다.
$("body").undelegate();
정의 및 사용
undelegate() 메서드는 버전 3.0에서 더 이상 사용되지 않습니다. 대신 off() 메서드를 사용하십시오.
undelegate() 메서드는 delegate() 메서드 로 추가된 하나 이상의 이벤트 핸들러를 제거합니다 .
통사론
$(selector).undelegate(selector,event,function)
Parameter | Description |
---|---|
selector | Optional. Specifies the selector to remove event handlers from |
event | Optional. Specifies one or more event types to remove handler functions from |
function | Optional. Specifies a specific event handler function to remove |
직접 해보십시오 - 예
undelegate() 메서드를 사용하여 모든 <p> 요소에 대한 모든 클릭 이벤트 핸들러를 제거하는 방법.
undelegate() 메서드를 사용하여 특정 함수만 제거하는 방법입니다.