jQuery on() Function - jQuery Tutorial 36

Поделиться
HTML-код
  • Опубликовано: 9 сен 2024
  • Notes for You:: jQuery on() Function - jQuery Tutorial 36
    - is used to add one or more events to an HTML element
    1. Adding an event using on function
    Ex :
    $("p").click(function(){
    $(this).text("mouse clicked");
    });
    $("p").mouseover(function(){
    $(this).text("mouse over");
    });
    $("p").mouseout(function(){
    $(this).text("mouse out");
    });
    OR
    $("p").on("click",function(){
    $(this).text("mouse clicked");
    });
    $("p").on("mouseover",function(){
    $(this).text("mouse over");
    });
    $("p").on("mouseout",function(){
    $(this).text("mouse out");
    });
    2. Adding multiple events using a single on function
    Ex:
    $("p").on({
    click:function(){
    $(this).text("mouse clicked");
    },
    mouseover:function(){
    $(this).text("mouse over");
    },
    mouseout:function(){
    $(this).text("mouse out");
    }
    =========================================
    Follow the link for next video:
    • jQuery Get & Set Conte...
    Follow the link for previous video:
    • jQuery Form Events - j...
    =========================================
    jQuery Tutorials Playlist:-
    • jQuery Tutorials
    =========================================
    Watch My Other Useful Tutorials:-
    jQuery UI Tutorials Playlist:-
    • jQuery UI Tutorials
    Bootstrap Tutorials Playlist:-
    • Bootstrap4 Tutorials
    Dreamweaver Tutorials Playlist:-
    • Dreamweaver Tutorials
    =========================================
    ► Subscribe to our RUclips channel:
    / chidrestechtutorials
    ► Visit our Website:
    www.chidrestec...
    =========================================
    Hash Tags:-
    #ChidresTechTutorials #jQuery #jQueryTutorial

Комментарии •