JQuery Callback Function Example

by Krishna Srinivasan

HTML

<!DOCTYPE html>
<head>
   <title>Callback object</title>
    </head>
<body>
   <p>After clicking on this line, this line will be hidden.</p>
</body>
</html>

JavaScript

$(document).ready(function() {
     $("p").click(function() {
      $("p").hide("fast",function(){
       document.write("The line is hidden now..");
      });
    });
 });