Im creating an autogenerated page from an XML-structure, it has the style like;
<p class=foo>ClickMe</p>
<div class=foo">
###somedata####
</div>
and then another just like it, etc, etc.
The idea is that i then can click on the paragraf and show/hide the div content. (is this smart or can you do it in another more dynamic way?)
$("p").click(function()
{
$("div").toggle("fast");
});
Now all “div” elements will hide, “div.nameonlcass” will do what i want, i have searched but have not manage to find how to get the class name.
Im new to jquery and im geussing this is a pretty easy fix.
Thanks in advance.
Try this