I'm looking to use jquery for a sort of toggle button to toggle between the two below states;


So everything in picture A (above the red line) is hidden when i click the Toggle Button/link and when i click the toggle button again, it reappears.
I've been looking into Jquerys toggleClass function;
$("button").click(function(){
$("p").toggleClass("main");
});
But this i beleive would only hide the CSS, not the HTML too. Am i misusing the function or is not make for this?
thanks
.mainincludesdisplay:nonethen it will cause any elements matched, and given that class, to no longer be visible. The HTML and CSS still exists in the DOM, though.