Front/JS & jQuery

[jQuery] .off() - 이벤트 해제하기

오선지♬ 2022. 6. 12. 10:42
728x90
반응형

 

Syntax

.off()

.off( event )

.off( events [, selector ] )

.off( events [, selector ] [, handler ] )

➡ .off() 메서드는 연결된 이벤트 핸들러를 제거한다.

➡ + () 안에 특정 이벤트를 작성하면 해당 이벤트만 제거된다.

➡ + selector (선택자)까지 작성하면 해당 선택된  영역에서 해당 이벤트만 제거된다.

➡ + handler까지 적어주면 해당 선택영역의 해당이벤트를 제거하고 새로운 이벤트가 실행된다.

 

 

참조 https://api.jquery.com/off/

 

.off() | jQuery API Documentation

Description: Remove an event handler. The .off() method removes event handlers that were attached with .on(). See the discussion of delegated and directly bound events on that page for more information. Calling .off() with no arguments removes all handlers

api.jquery.com

 

728x90
반응형