I'm trying to implement a jQuery toggle button that switches between two states below;
When I click the Toggle Button/link, everything in picture A (above the red line) should be hidden. Clicking the toggle button again would make it reappear.
I've been researching jQuery's toggleClass function;
$("button").click(function(){
$("p").toggleClass("main");
});
However, I believe this only hides the CSS and not the HTML content. Am I misusing the function or is it not suitable for this purpose?
Thank you