Food For Thought
I'm sure one of the JS gurus will help you out, but as food for thought, maybe consider an alternative method to hiding and displaying elements on a page, especially if the content is static (not database driven).
The JS to hide/show elements could be triggered by onclick events on check boxes, onchange events in text boxes or whatever.
Imo programmitically creating and manipulating elements in JS can get messy.
Anyway, just food for thought