Blur Event using JQUERY

When crusher is moved out by tag or Mouse is clicked else where then the blur event is triggered.
$(selector).blur()

  • Video Tutorial on form component events


While using focus event we have seen how to execute the code when the object is in focus, now we will develop a validation code to check if any date is entered or not. If user is moved out without entering any data then we will display the message.

Here is the code
<script>
$(document).ready(function() {
$('#t1').blur(function(){
var str1=$('#t1').val();
if(str1.length<1){
$('#d1').html('Please enter name');
}
});

$('#t2').blur(function(){
var str2=$('#t2').val();
if(str2.length<1){
$('#d1').html('Please enter email ');
}
});

})

</script>
DEMO of Blur Event
Event Reference Focus Event

Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com



    Post your comments , suggestion , error , requirements etc here .







    Most Popular JQuery Scripts

    1

    Two dependant list boxes

    2

    Calendar with Date Selection

    3

    Data change by Slider

    4

    Show & Hide element


    JQuery Video Tutorials




    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2021 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer