[jQuery] Hide/show question with dl/dt/dd

[jQuery] Hide/show question with dl/dt/dd

<html>
<body>
Hi folks,
I have a simple faq application with the question within a dt tag and the
corresponding answer within a dd tag.
I had hoped that my onload code of:
<tt>$('dt.toggle').bind("click",
function(){$(this).parent('dt').next('dd').slideToggle(500);return
false;});
</tt>would have revealed the hidden answer until the question was
clicked.
I tried wrapping the question in an a tag (with class=toggle) and the
code:
<tt>$('a.toggle').bind("click",
function(){$(this).parent('dt').next('dd').slideToggle(500);return
false;});
</tt>but this also proved wrong.
Clearly, I don't understand something here - would someone mind
enlightening me please?
Thanks,
Bruce
</body>
</html>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/