Fade out element

Description

The following code shows how to fade out element.

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() {<!-- ww  w  .jav a  2s.  c  o  m-->
    $("input").focus(function() {
      $(this).next("span").fadeOut(1000);
    });
  });
</script>
<style>
div.dbl {
  background: yellow;
  color: black;
}
</style>
</head>
<body>
  <p>
    <input type="text" /> <span>focus fire</span>
  </p>

  <p>
    <input type="password" /> <span>focus fire</span>
  </p>
</body>
</html>

Click to view the demo





















Home »
  jQuery »
    jQuery Example »




Animation
DOM
Event
Form
List
Select
Style
Table
Utilities