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();
});

 

Tags : jQuery

Related Post

Maksud

Maksud

I am a thinker, not a talker.