jQuery slideDown()
with speed
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"> </script>//from www. j a v a2 s .co m <script> $(document).ready(function(){ $(".btn1").click(function(){ $("p").slideUp(1000); }); $(".btn2").click(function(){ $("p").slideDown(1000); }); }); </script> </head> <body> <p>This is a paragraph.</p> <button class="btn1">Slide up</button> <button class="btn2">Slide down</button> </body> </html>