jQuery toggle() Method
jQuery toggle() Method
The toggle() method is used to toggles between hide() and show() for the selected elements. If the element is visible, it will use the hide() method to hide that element. If the element is hidden, then it will use show() method to show it.
Syntax:-
Its syntax is:- $(selector).toggle(speed, easing, callback)
Further Explanation:-
Parameter | Description |
---|---|
speed | Optional. Specifies the speed of the effect. |
easing | Optional. Specifies the speed of the element in different points of the animation. Default is swing |
callback | Optional. A function to be executed after the toggle() method is completed |