Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • what is jquery blur method?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 267
    Comment on it

    Hello Readers,

    Jquery blur is the jquery method which is used to attach the function to the jquery event and the function get executed to a given element after the event occurs. Event lose the focus when we click on input field and it performs the action.

    Syntax :

    $(selector).blur( function ()  { do some useful work });
    

    For Example :

    <!DOCTYPE html>
    <html>
    <head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <script>
    $(document).ready(function(){
        $("input").blur(function(){
            $(this).css("background-color", "#ffffff");
        });
    });
    </script>
    </head>
    <body>
    
    Name: <input type="text" name="fullname"><br>
    Email: <input type="text" name="email">
    
    </body>
    </html>
    

    In the above example, blur method work on Css Event when we click on input field it change its background color.

 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: