이벤트 제거 메서드 : off()
기본형
$("이벤트 대상").off("제거할 이벤트 종류");
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<title>Document</title>
<script>
$(function() {
$('.btn1').click(function() {
$('.btn1').parent().next().css({color:'red'});
});
$('.btn2').on({
'mouseover focus': function() {
$('.btn2').parent().next().css({color : 'lime'});
}
});
$('.btn1').off('click');
$('.btn2').off('mouseover focus');
});
</script>
</head>
<body>
<p>
<button class="btn1">버튼1</button>
</p>
<p>내용1</p>
<p>
<button class="btn2">버튼2</button>
</p>
<p>내용2</p>
</body>
</html>