Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to use bind() Method in Jquery ?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 149
    Comment on it

    Hi Reader's,
      Welcome to FindNerd, today we are going to discuss how to use bind() Method in Jquery.

    The bind()methods is one of the most important aspects of dealing with events through jQuery.
    Basically,the bind() method affixes one or more event handlers for culled elements, and designates a function to run when the event occurs.

    Syntax of bind() Method

    $(selector).bind(event,data,function,map)

    event and function both are required parameter.

    you can see below example:

    <!DOCTYPE html>
    <html>
    <head>
    <!-- here add jquery library -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
    <script>
    $(document).ready(function(){
      //here call bind() method
        $("p").bind("click", function(){
          //alert success message
            alert("success ! clicked.");
        });
    });
    </script>
    </head>
    <body>
      <!-- define here paragraf  -->
    <p>Click alert !</p>
    
    </body>
    </html>
    

     

     

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: