Cookie Notice

As far as I know, and as far as I remember, nothing in this page does anything with Cookies.

2009/04/09

Investigating jQuery

So, you have a bunch of HTML elements. Let's say they're Fieldsets.



x
XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX


x
XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX


x
XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX



Now, you want to be able to hide some of those fieldsets. You could make the legend clickable.



x
XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX



hide_element() is dead easy. I do it in five lines. I could drop one if I wanted. Just a bit of stylesheet manipulation. But there's a problem. As written, that hides the fieldset for good. I really want to toggle. So, something must remain.



x
XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX




This is better, but you have to name every single fieldset. There should be a way to address everything anonymously. And there is. jQuery. Which I don't quite grok yet. But that's where my head is.