toggle() is an important type of procedure that is used to toggle between the methods of the hide() and show(). It simply attached multiple functions to toggle for the selected elements. You can consider that it shows the hidden elements and hide the shown elements.

Syntax

$(selector).toggle(function)

BY Best Interview Question ON 16 Aug 2019