How to use jQuery toggle() method
jQuery

How to use jQuery toggle() method

By using jQuery, You can toggle between hiding and showing HTML elements with the toggle() method.

Shown elements are hidden and hidden elements are shown:

Syntax:

$(selector).toggle(speed,callback);

Example:

$("#show-hide").click(function(){
  $("p").toggle();
});

 

Get The latest Coding solutions.

Subscribe to the Email Newsletter