Expand/collapse function with slideToggle('slow') - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:slideToggle

Description

Expand/collapse function with slideToggle('slow')

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> 
   </head> 
   <body> 
      <div class="sitesection"> 
         <p class="expand">
            <a href="#">Click Here To Display The Content</a>
         </p> 
         <p class="content">Hello World!"</p> 
      </div> 
      <script>
$('.expand').click(function(){
    $('.content').slideToggle('slow');
});/*  w  w w.jav  a2  s.c o  m*/

      </script>  
   </body>
</html>

Related Tutorials