jQuery 제이쿼리

[이벤트 연결] on() - 문자열 또는 객체로 지정

chloeize 2021. 5. 12. 23:10
728x90

    <script>

 

        // 문자열로 지정

        $('h2').on('click'100function (event){

            $(this).html('clicked');

        });

 

        // 객체로 지정

 

        $('h2').on({

 

            dblclick : function(){

                $(this).html('dbclicked')

            },

 

            mouseenter : function (){

                $(this).html('mouseentered')

                // mouseenter :  마우스가 태그 내로 들어왔을 때

            }

 

        });

 

    </script>

 

728x90