Jam's story
[JQuery] on() 메소드 본문
<script>
$(function (){
/*
$("button")
.click(function (){
$(this).hide();
})
.mouseenter( func);
*/
/*[암기] jquery Ajax 처리할 때는 on("이벤트 ")
$("button").on("click", function (){
$(this).hide();
});
*/
// 하나 이상의 이벤트 핸들러를 연결할 때 사용하는 메서드
$("button").on({
mouseenter : function (){
$(this).css("background-color", "lightgray");
},
mouseleave : function (){
$(this).css("background-color", "lightblue");
},
click: function (){
$(this).css("background-color", "yellow");
}
});
});
</script>
'WEB > JQuery' 카테고리의 다른 글
[JQuery] Fade (0) | 2022.06.10 |
---|---|
[JQuery] hide (0) | 2022.06.10 |
[JQuery] 메뉴클릭하면 글이 나오도록 (0) | 2022.06.06 |
[JQuery] < ,> 버튼 과 목차버튼으로 이미지 넘기기 (0) | 2022.06.06 |
[JQuery] input에서 입력받아 li태그로 만들기 (0) | 2022.06.02 |
Comments