Jquery Onblur Example - Jquery

How to use onblur event in jquery?

Snippet Code


  
Rate this page :
  [ 0 votes]

This simple jquery onblur code is an event handler which occurs when an object loses focus. The onblur event used with form validation like when the user leaves a form field.The Sample jquery onblur code is given below.

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script> <script> function check() { var txt=$("#blurevent").val(); alert("Entered Text is : "+txt); } </script> <div align='center'> <b>Enter Text :</b> <input type='text' id='blurevent' onblur='check()'> </div>

Tags


Ask Questions

Ask Question