Change text value of div with an effect - Javascript jQuery

Javascript examples for jQuery:Text

Description

Change text value of div with an effect

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.7.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){//from  w  w w .  ja va 2s. c  o  m
$("#sometext").fadeOut(function() {
  $(this).text("change!").fadeIn();
});
    });

      </script> 
   </head> 
   <body> 
      <div id="sometext">
          Start text 
      </div>  
   </body>
</html>

Related Tutorials