Blur() event handler on search input box - Javascript jQuery

Javascript examples for jQuery:Form Input

Description

Blur() event handler on search input box

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-1.8.3.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){//from   w  w  w. jav a  2  s.  co  m
$('input[name="Search"]').blur(function(e) {
    $(this).val('');
});
    });

      </script> 
   </head> 
   <body> 
      <input name="Search" type="text" id="Search" class="MainMenu" value="123">  
   </body>
</html>

Related Tutorials