JQuery Forms Blur

From CoderLearner
Jump to: navigation, search

Description

Bind the event to the blur javaScript event or trigger that event on an element.

Syntax

$.blur( handler(event object) );

$.blur( [ event data ] , handler(event object));

Example 1

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>Blur</title>
	<script 
		type="text/javascript" 
	        src="jquery.min.js">				 
	</script>
	<script>
	    $().ready(function() {
               $('input[name="input3"]').blur(function(){
                   alert('blur it');
               });
	     });
        </script>
</head>
<body>

   <form>
        <input type="text" name="input3"/>
   </form>
</body>
</html>

Try It

Example 2

  $().ready(function() {
                $('p.poorworld').bind('click blur',function(){
                    alert('good');
                });
  });

<p class="poorworld">
        It is a poor world, nothing important!
</p>