jQuery | slideToggle() Method Last Updated : 19 Feb, 2019 Summarize Comments Improve Suggest changes Share 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= "https://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 More infoAdvertise with us Next Article jQuery | slideToggle() Method C Code_Mech Follow Improve Article Tags : Web Technologies JQuery jQuery-Effects Similar Reads jQuery toggle() Method The toggle() method is used to check the visibility of selected elements to toggle between hide() and show() for the selected elements. show() is run when the element is hidden. hide() is run when the element is visible. Syntax: $(selector).toggle(speed, easing, callback) Parameters: It has three op 1 min read jQuery UI | toggle() Method jQuery UI framework provides toggle() method to display the switch between show or hide functionalities depending on the status of the selected elements and the type of toggle effect chosen by the user. Syntax: (selector).toggle( effectType [, options ] [, duration ] [, complete ] ) Parameters: This 4 min read jQuery | slideDown() Method The slideDown() Method in jQuery is used to check the visibility of selected elements or to show the hidden elements. It works on two types of hidden elements: Elements hidden using jQuery methods.Elements hidden using display: none in CSS. Syntax: $(selector).slideDown( speed, easing, callback ) Pa 2 min read jQuery slideUp() Method The slideUp() is an inbuilt method in jQuery which is used to hide the selected elements. Syntax: $(selector).slideUp(speed); Parameter: It accepts an optional parameter "speed" which specifies the speed of the duration of the effect. jQuery examples to show the working of slideUp() method:Example 1 1 min read Explain slide toggle method in jQuery The slideToggle() is a method in jQuery which is an alternative for two separate methods namely slideUp() and slideDown(). This actually plays with the CSS display property of the element and provides a slight animation to it. If the element has a "display:none", the slideDown() functionality gets t 2 min read Like