- <fieldset>
- <legend> x </legend>
- XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX
- </fieldset>
- <fieldset>
- <legend> x </legend>
- XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX
- </fieldset>
- <fieldset>
- <legend> x </legend>
- XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX
- </fieldset>
Now, you want to be able to hide some of those fieldsets. You could make the legend clickable.
- <fieldset id="target">
- <legend onclick="hide_element('target')"> x </legend>
- XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX
- </fieldset>
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.- <fieldset>
- <legend onclick="hide_element('target')"> x </legend>
- <div id="target"> XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX </div>
- </fieldset>
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.
No comments:
Post a Comment