jquery 02 다중 이벤트 처리하기
프론트엔드/Jquery2021. 3. 17. 19:34
문서 준비 이벤트에는 여러 다중 이벤트를 정의할 수 있습니다.
버튼을 클릭하면 이벤트 처리를 합니다.
<!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">
<title>Document</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function() {
$("button.hide").click(function(){
$("p").hide();
});
$("button.show").click(function(){
$("p").show();
});
});
</script>
</head>
<body>
<p>문서 준비 이벤트에는 여러 다중 이벤트를 정의할 수 있습니다.</p>
<p>버튼을 클릭하면 이벤트 처리를 합니다.</p>
<button class="hide">메시지 삭제</button>
<button class="show">메시지 보기</button>
</body>
</html>
'프론트엔드 > Jquery' 카테고리의 다른 글
jquery 06 mousedown()와 mouseup() 메소드 (0) | 2021.03.17 |
---|---|
jquery 05 mouseenter()와 mouseleave() 메소드 (0) | 2021.03.17 |
jquery 04 mouseenter() 메소드 (0) | 2021.03.17 |
jquery 03 퀴즈 프로그램 만들기 (0) | 2021.03.17 |
jquery 01 버튼 클릭 시 메시지 사라지는 효과 (0) | 2021.03.17 |
댓글()