이벤트 한번만 실행
·
개발중/JavaScript
.one() 특정 처리기를 한 번만 실행해야 하는 경우도 있습니다. jQuery는 이 목적을 위해 메서드를 제공합니다. $( "p" ).one( "click", function() { console.log( "You just clicked this for the first time!" ); $( this ).click(function() { console.log( "You have clicked this before!" ); }); });