Jquery Events

  • STEPS

    1. Click Event

    in html, create the html element

    
                        //using specific tag
                        <p>Click Here</p>
    
                            OR
    
                        //using class
                        <p class="btn_click">Click Here</p>
    
                            OR
    
                        //using id
                        <p id="btn_click">Click Here</p>
    
                      

    in jquery, define click event function

    
                          //if html tag 
                          $("p").click(function(){
                             alert(1);
                          });
    
                          OR
    
                          //if class
                          $(".btn_click").click(function(){
                             alert(1);
                          });
    
    
                          OR
    
                          //if id
                          $("#btn_click").click(function(){
                             alert(1);
                          });