Jquery Blur Event Example - Jquery

How to use blur event in jquery?

Snippet Code


  
Rate this page :
  [ 0 votes]

The jquery code creates a blur event when an element loses it focus. It creates an alert message when the field is in out of focus. The example code for jquery blur event is given below.

<input type='text' value="" id='inp'> <script type='text/javascript' src='./jquery.js'></script> <script type='text/javascript'> $(document).ready(function(){ $("input").blur(function(){ alert("Your input value is " + $("#inp").val()); }); }); </script>

Tags


Ask Questions

Ask Question