From jQuery JavaScript Library
« Back to Effects
toggle( )
Toggles displaying each of the set of matched elements.
If they are shown, toggle makes them hidden. If they are hidden, toggle makes them shown.
Examples:| Name | Type |
Toggles all paragraphs.
$("button").click(function () {
$("p").toggle();
});