Monday 17 October 2011

Use the function argument to modify the value of an input box. in jquery



<!DOCTYPE html>
<html>
<head>

  <script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>

  <p>Type something and then click or tab out of the input.</p>
  <input type="text" value="type something" />

<script>
  $('input').bind('blur', function() {
    
    $(this).val(function(i, val) {
      return val.toUpperCase();
    });
  
  });
  </script>

</body>
</html>