[jQuery] Noob click-change-click question re. parent class rules
I've been going through various tutorials and demos of jQuery, and
finding my way fairly well, at least with the basics.
To work my way through a few concepts , I put up a quick demo of a
show/hide Faq-type system
http://www.mredesign.com/demos/jquery-show-hide/
but as I did so, I had a question about changing classes that I'm
hoping someone here can explain
In this demo, I initially had any sibling element as clickable - so
that any other element inside the 'offDiv' or 'onDiv' container would
work to show or hide the 'show-hide' div, not just the little link
button - and the heading div worked great.. but only for one click. I
wanted to click the header (this worked), which would change the class
of the container (this als worked), and then click again to close the
box under rule for new parent class (this did not work).
I was referencing the element by the parent container '.offDiv