Adding to Mat's solution to work for many fieldsets:

$("legend").click(function() { $(this).next("ul").toggle(); });


On Mar 16, 4:05 pm, Mat Schaffer <mat.schaf...@gmail.com> wrote:
> Tried something like this?
>
> $("legend").click(function() { $("fieldset ul").toggle(); });
>
> On Mar 15, 2009, at 10:40 AM, shapper wrote:
>
>
>
> > Hello,
>
> > I have a list of fieldsets and each one has a legend.
> > I am thinking in having something like:
>
> > <fieldset>
> >  <legend>Personal Data</legend>
> >  <ul>
> >    <li>first element</li>
> >    <li>second element</li>
> >  </ul>
> > </fieldset>
>
> > How can Show/Hide the ul when I click the legend?
>
> > I would like to have many fielsets on a form and being able to Show/
> > Hide the contents of any fieldset.
>
> > Thanks,
> > Miguel
>
>

Reply via email to