jQuery | slideToggle() Method Last Updated : 19 Feb, 2019 Comments Improve Suggest changes Like Article Like Report The slideToggle() Method in jQuery is used to show the hidden elements or hide the visible elements respectively i.e. it toggles between the slideUp() and slideDown() methods. slideDown() is run when the element is hidden. slideUp() is run when the element is visible. Syntax: $(selector).slideToggle()( speed, easing, callback ) Parameters: This method accepts three parameter as mentioned above and described below: Speed: It is an optional parameter and used to specify the speed of the fading effect. The default value of speed is 400 millisecond. The possible value of speed are: milliseconds "slow" "fast" easing: It is an optional parameter and used to specify the speed of element to different points of animation. The default value of easing is "swing". The possible value of easing are: "swing" "linear" callback: It is optional parameter. The callback function is executed after slideToggle() method is completed. Below example illustrates the slideToggle() method in jQuery: Example: This example display or hide the element. html <!DOCTYPE html> <html> <head> <title> jQuery slideToggle() Method </title> <script src= "http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"> </script> <!-- Script to illustrates slideToggle() method --> <script> $(document).ready(function() { $("button").click(function() { $("h1").slideToggle(); }); }); </script> </head> <body> <h1 style="color:green"> GeeksforGeeks </h1> <button> Click on button to hide/show content </button> </body> </html> Output: Before click on the button: After single click on the button: After double click on the button: Comment C Code_Mech Follow 0 Improve C Code_Mech Follow 0 Improve Article Tags : Web Technologies JQuery jQuery-Effects Explore jQuery Tutorial 7 min read Getting Started with jQuery 4 min read jQuery Introduction 7 min read jQuery Syntax 2 min read jQuery CDN 4 min read jQuery SelectorsJQuery Selectors 5 min read jQuery * Selector 1 min read jQuery #id Selector 1 min read jQuery .class Selector 1 min read jQuery EventsjQuery Events 4 min read jQuery bind() Method 2 min read jQuery blur() Method 1 min read jQuery change() Method 2 min read jQuery EffectsjQuery animate() Method 2 min read jQuery clearQueue() Method 2 min read jQuery delay() Method 2 min read jQuery HTML/CSSjQuery addClass() Method 2 min read jQuery after() Method 1 min read jQuery append() Method 2 min read jQuery TraversingjQuery | Traversing 4 min read jQuery add() method 1 min read jQuery addBack() Method 2 min read Like