Handle input change event

Description

The following code shows how to handle form input Text input change event.

Example


<html>
<head>
<script type="text/javascript"
  src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
  $(document).ready(function() {<!-- w  w w  .  ja v  a 2s .c o  m-->
    $("input").change(function() {
      alert($(this).val());
    });
  });
</script>
</head>
<body>
  <p>
    <input type="text" /> <span>blur fire</span>
  </p>
  <p>
    <input type="password" /> <span>blur fire</span>
  </p>
</body>
</html>

Click to view the demo





















Home »
  jQuery »
    jQuery Example »




Animation
DOM
Event
Form
List
Select
Style
Table
Utilities