728x90
반응형
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="../js/jquery.min.js"></script>
<style>
</style>
<script>
$(document).ready(function(){
$(".btn_1").on("mouseover",function(){
console.log("hello")
})
$(".del_1").on("click",function(){
$(".btn_1").off("mouseover")
console.log("mouseover 이벤트 해제")
})
})
</script>
<title>Document</title>
</head>
<body>
<button class="btn_1">버튼1</button>
<button class="del_1">버튼1 이벤트 해제</button>
</body>
</html>
버튼1에 mouseover 될대마다 "hello" 출력
버튼2 click하면 btn_1의 mouseover를 끄면서 해제콘솔 출력
728x90
반응형
'HTML+CSS(복습)' 카테고리의 다른 글
2023-05-17(수) slideUp , slideDown , slideToggle (0) | 2023.05.17 |
---|---|
2023-05-17(수) show , hide , toggle (0) | 2023.05.17 |
2023-05-16(화) mouseover , mouseout (0) | 2023.05.17 |
2023-05-16(화) click , index (0) | 2023.05.17 |
2023-05-16(화) keydown (0) | 2023.05.17 |