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

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 327
    Comment on it

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

    The blur() Method occurs when an element loses focus hence we can say that blur() method is used for attaching a function to run when a blur event occurs.blur() method is also triggers the blur event.

    syntax of blur() method

     $(selector).blur()

    The above syntax is used to Trigger the blur event for the selected elements.

    $(selector).blur(function)

    This syntax is used for Attaching a function to the blur event.

    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 blur() method
        $("input").blur(function(){
          //alert message
            alert("blur its focus");
        });
    });
    </script>
    </head>
    <body>
    
    Fill your name: <input type="text">
    
    <!--when you will Write something in the input field,and then click outside the field to blur focus-->
    
    </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: